# Path: luna/utils/ip.py
# def ntoa(num_ip, ver=4):
# def aton(ip, ver=4):
# def reltoa(num_net, rel_ip, ver):
# def atorel(ip, num_net, prefix, ver=4):
# def get_num_subnet(ip, prefix, ver=4):
# def ip_in_net(ip, num_net, prefix, ver=4):
# def guess_ns_hostname():
# def get_ip_version(ip):
# def ipv6_unwrap(ip):


from mock import patch
from luna.utils import ip
import unittest

        # Floating IP available with '-' in hostname

        gethostbyname.return_value = '172.16.1.254'
        gethostname.return_value = 'controller-1.cluster'

        self.assertEqual(ip.guess_ns_hostname(), 'controller')

        # Floating IP available without '-' in hostname

        gethostname.return_value = 'controller1.cluster'

        self.assertEqual(ip.guess_ns_hostname(), 'controller')

        # Hostname does not end with digits

        gethostname.return_value = 'controller.cluster'

        self.assertEqual(ip.guess_ns_hostname(), 'controller')


class UtilsIPTestsV6(unittest.TestCase):

    def setUp(self):
        print

    def test_aton_with_valid_ip(self):
        self.assertEqual(
            ip.aton('fd12:3456:789a:1::1', 6),
            336389205813283084628800618700287770625

# Path: luna/utils/ip.py
# def ntoa(num_ip, ver=4):
# def aton(ip, ver=4):
# def reltoa(num_net, rel_ip, ver):
# def atorel(ip, num_net, prefix, ver=4):
# def get_num_subnet(ip, prefix, ver=4):
# def ip_in_net(ip, num_net, prefix, ver=4):
# def guess_ns_hostname():
# def get_ip_version(ip):
# def ipv6_unwrap(ip):


# Path: tests/unittests/test_utils_ip.py
from mock import patch
from luna.utils import ip
import unittest


        # Floating IP available with '-' in hostname

        gethostbyname.return_value = '172.16.1.254'
        gethostname.return_value = 'controller-1.cluster'

        self.assertEqual(ip.guess_ns_hostname(), 'controller')

        # Floating IP available without '-' in hostname

        gethostname.return_value = 'controller1.cluster'

        self.assertEqual(ip.guess_ns_hostname(), 'controller')

        # Hostname does not end with digits

        gethostname.return_value = 'controller.cluster'

        self.assertEqual(ip.guess_ns_hostname(), 'controller')


class UtilsIPTestsV6(unittest.TestCase):

    def setUp(self):
        print

    def test_aton_with_valid_ip(self):
        self.assertEqual(
            ip.aton('fd12:3456:789a:1::1', 6),
            336389205813283084628800618700287770625

        )