def test_no_ips(self):
        counter = itertools.count()
        virnetwork = mock.Mock()
        hypervisor = mock.Mock()
        virnetwork.XMLDesc.side_effect = lambda x: '<a><ip address="192.168.{}.1"/></a>'.format(next(counter))
        hypervisor.listNetworks.return_value = range(0, 256)
        hypervisor.networkLookupByName.return_value = virnetwork

        with self.assertRaises(RuntimeError):
            network.valid_address(hypervisor)
RuntimeError is raised if all IPs are taken.
dataset/ETHPy150Open F-Secure/see/see/context/resources/test/network_test.py/ValidAddressTest.test_no_ips