Example #1
0
 def test_get_network_detach_config_spec(self):
     result = vm_util.get_network_detach_config_spec(
             fake.FakeFactory(), 'fake-device', 2)
     expected = """{
         'extraConfig': [{'value': 'free',
                          'key': 'nvp.iface-id.2',
                          'obj_name': 'ns0:OptionValue'}],
         'deviceChange': [{'device': 'fake-device',
                           'operation': 'remove',
                           'obj_name': 'ns0:VirtualDeviceConfigSpec'}],
         'obj_name':'ns0:VirtualMachineConfigSpec'}"""
     expected = re.sub(r'\s+', '', expected)
     result = re.sub(r'\s+', '', repr(result))
     self.assertEqual(expected, result)
Example #2
0
 def test_get_network_detach_config_spec(self):
     result = vm_util.get_network_detach_config_spec(
             fake.FakeFactory(), 'fake-device', 2)
     expected = """{
         'extraConfig': [{'value': 'free',
                          'key': 'nvp.iface-id.2',
                          'obj_name': 'ns0:OptionValue'}],
         'deviceChange': [{'device': 'fake-device',
                           'operation': 'remove',
                           'obj_name': 'ns0:VirtualDeviceConfigSpec'}],
         'obj_name':'ns0:VirtualMachineConfigSpec'}"""
     expected = re.sub(r'\s+', '', expected)
     result = re.sub(r'\s+', '', repr(result))
     self.assertEqual(expected, result)