Skip to content

Commit

Permalink
Fix Azure tests (google#355)
Browse files Browse the repository at this point in the history
Signed-off-by: Theo Giovanna <gtheo@google.com>
  • Loading branch information
giovannt0 committed Jul 23, 2021
1 parent 52b90bc commit b442f2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/providers/azure/internal/test_compute.py
Expand Up @@ -225,7 +225,7 @@ def testCreateDiskFromSnapshotUri(self,
@mock.patch('libcloudforensics.providers.azure.internal.compute.AZCompute.GetInstance')
@mock.patch('libcloudforensics.providers.azure.internal.compute.AZCompute._GetInstanceType')
@mock.patch('libcloudforensics.providers.azure.internal.network.AZNetwork.CreateNetworkInterface')
@mock.patch('azure.mgmt.compute.v2021_03_01.operations._virtual_machines_operations.VirtualMachinesOperations.begin_create_or_update')
@mock.patch('azure.mgmt.compute.v2021_04_01.operations._virtual_machines_operations.VirtualMachinesOperations.begin_create_or_update')
@typing.no_type_check
def testGetOrCreateAnalysisVm(self,
mock_vm,
Expand Down Expand Up @@ -262,7 +262,7 @@ def testGetOrCreateAnalysisVm(self,
self.assertEqual('fake-analysis-vm-name', vm.name)
self.assertTrue(created)

@mock.patch('azure.mgmt.compute.v2021_03_01.operations._virtual_machine_sizes_operations.VirtualMachineSizesOperations.list')
@mock.patch('azure.mgmt.compute.v2021_04_01.operations._virtual_machine_sizes_operations.VirtualMachineSizesOperations.list')
@typing.no_type_check
def testListVMSizes(self, mock_list):
"""Test that instance types are correctly listed."""
Expand Down Expand Up @@ -292,7 +292,7 @@ class AZVirtualMachineTest(unittest.TestCase):
# pylint: disable=line-too-long

@mock.patch('libcloudforensics.providers.azure.internal.compute.AZCompute.ListDisks')
@mock.patch('azure.mgmt.compute.v2021_03_01.operations._virtual_machines_operations.VirtualMachinesOperations.get')
@mock.patch('azure.mgmt.compute.v2021_04_01.operations._virtual_machines_operations.VirtualMachinesOperations.get')
@typing.no_type_check
def testGetBootDisk(self, mock_get_vm, mock_list_disk):
"""Test that the boot disk from an instance is retrieved."""
Expand Down Expand Up @@ -321,7 +321,7 @@ def testGetDisk(self, mock_list_disk):
'Microsoft.Compute/type/fake-vm-name', str(error.exception))

@mock.patch('libcloudforensics.providers.azure.internal.compute.AZCompute.ListDisks')
@mock.patch('azure.mgmt.compute.v2021_03_01.operations._virtual_machines_operations.VirtualMachinesOperations.get')
@mock.patch('azure.mgmt.compute.v2021_04_01.operations._virtual_machines_operations.VirtualMachinesOperations.get')
@typing.no_type_check
def testListDisks(self, mock_get_vm, mock_list_disk):
"""Test that disks from an instance are correctly listed."""
Expand Down

0 comments on commit b442f2f

Please sign in to comment.