@skipIf(not six.PY2, 'test applies only to python 2')
    def test_is_loopback(self):
        with patch.object(salt.ext.ipaddress.IPv4Address, 'is_loopback',
                          return_value=True):
            self.assertTrue(network.is_loopback('127.0.0.1'))
        with patch.object(salt.ext.ipaddress.IPv6Address, 'is_loopback',
                          return_value=True):
            self.assertTrue(network.is_loopback('::1'))
Test for Check if the given IP address is a loopback address
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/network_test.py/NetworkTestCase.test_is_loopback