def test_vnic_remove_from_vm_list(self):
        #arrange
        vm = create_autospec(spec=vim.vm)
        vm.config = Mock()
        vm.config.hardware = Mock()
        vm.config.hardware.device = [create_autospec(spec=vim.vm.device.VirtualEthernetCard)]

        #act
        device_change = VNicService.vnic_remove_from_vm_list(vm)

        #assert
        self.assertTrue(len(device_change) == 1)
예제 #2
0
    def test_vnic_remove_from_vm_list(self):
        #arrange
        vm = create_autospec(spec=vim.vm)
        vm.config = Mock()
        vm.config.hardware = Mock()
        vm.config.hardware.device = [
            create_autospec(spec=vim.vm.device.VirtualEthernetCard)
        ]

        #act
        device_change = VNicService.vnic_remove_from_vm_list(vm)

        #assert
        self.assertTrue(len(device_change) == 1)