def test_create_no_xml_too_many_attempts(self):
        hypervisor = mock.Mock()
        hypervisor.listNetworks.return_value = []
        hypervisor.networkCreateXML.side_effect = libvirt.libvirtError('BOOM')
        with self.assertRaises(RuntimeError) as error:
            network.create(hypervisor, 'foo', {}, max_attempts=1)
            self.assertEqual(str(error), "Too many attempts (1) to get a valid IP address.")
RuntimeError is raised if too many attempt to create a network are made.
dataset/ETHPy150Open F-Secure/see/see/context/resources/test/network_test.py/CreateTest.test_create_no_xml_too_many_attempts