Ejemplo n.º 1
0
 def test_is_private(self):
     """
     Test for Check if the given IP address is a private address
     """
     with patch.object(ipaddress.IPv4Address, "is_private", return_value=True):
         self.assertTrue(network.is_private("0.0.0.0"))
     with patch.object(ipaddress.IPv6Address, "is_private", return_value=True):
         self.assertTrue(network.is_private("::1"))
Ejemplo n.º 2
0
 def test_is_private(self):
     '''
     Test for Check if the given IP address is a private address
     '''
     with patch.object(ipaddress.IPv4Address, 'is_private',
                       return_value=True):
         self.assertTrue(network.is_private('0.0.0.0'))
     with patch.object(ipaddress.IPv6Address, 'is_private',
                       return_value=True):
         self.assertTrue(network.is_private('::1'))
Ejemplo n.º 3
0
 def test_is_private(self):
     '''
     Test for Check if the given IP address is a private address
     '''
     with patch.object(salt.ext.ipaddress.IPv4Address, 'is_private',
                       return_value=True):
         self.assertTrue(network.is_private('0.0.0.0'))
     with patch.object(salt.ext.ipaddress.IPv6Address, 'is_private',
                       return_value=True):
         self.assertTrue(network.is_private('::1'))
Ejemplo n.º 4
0
 def test_is_loopback(self):
     '''
     Test for Check if the given IP address is a loopback address
     '''
     with patch.object(salt.utils.network.IPv4Address, 'is_loopback',
                       return_value=False):
         self.assertFalse(network.is_private('0.0.0.0'))