# Path: iprestrict/ip_utils.py
# def get_version(ip):
# def is_ipv4(ip):
# def is_ipv6(ip):
# def to_number(ip):
# def ipv4_to_number(ip):
# def ipv6_to_number(ip):
# def explode(ip):
# def convert_mixed(ip):
# def to_ip(number, version=IPv4):
# def cidr_to_range(ip, prefix_length):
# def _ip_to_number(ip, separator='.', group_size=2 ** 8, base=10):
# def reject_empty(l):


from django.test import TestCase
from iprestrict import ip_utils as ipu
# -*- coding: utf-8 -*-
from __future__ import unicode_literals



class GetVersionTest(TestCase):
    def test_IPV4_if_no_colons(self):
        self.assertEqual(ipu.IPv4, ipu.get_version('192.168.1.1'))

    def test_IPV6_if_both_colons_and_dots(self):
        self.assertEqual(ipu.IPv6, ipu.get_version('::ffff:129.144.52.38'))

    def test_IPV6_if_only_colons(self):
        self.assertEqual(ipu.IPv6, ipu.get_version('::'))
        self.assertEqual(ipu.IPv6, ipu.get_version('::1'))


class IPToNumberTest(TestCase):
    def test_ip_to_number_conversions(self):

# Path: iprestrict/ip_utils.py
# def get_version(ip):
# def is_ipv4(ip):
# def is_ipv6(ip):
# def to_number(ip):
# def ipv4_to_number(ip):
# def ipv6_to_number(ip):
# def explode(ip):
# def convert_mixed(ip):
# def to_ip(number, version=IPv4):
# def cidr_to_range(ip, prefix_length):
# def _ip_to_number(ip, separator='.', group_size=2 ** 8, base=10):
# def reject_empty(l):


# Path: tests/test_ip_utils.py
from django.test import TestCase
from iprestrict import ip_utils as ipu

# -*- coding: utf-8 -*-
from __future__ import unicode_literals



class GetVersionTest(TestCase):
    def test_IPV4_if_no_colons(self):
        self.assertEqual(ipu.IPv4, ipu.get_version('192.168.1.1'))

    def test_IPV6_if_both_colons_and_dots(self):
        self.assertEqual(ipu.IPv6, ipu.get_version('::ffff:129.144.52.38'))

    def test_IPV6_if_only_colons(self):
        self.assertEqual(ipu.IPv6, ipu.get_version('::'))
        self.assertEqual(ipu.IPv6, ipu.get_version('::1'))


class IPToNumberTest(TestCase):
    def test_ip_to_number_conversions(self):

        self.assertEqual(0, ipu.to_number('0.0.0.0'))