Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated unittest aliases #20337

Merged
merged 1 commit into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -363,14 +363,14 @@ def test_compute_vm_2(self, resource_group):
result = self.mgmt_client.virtual_machines.begin_perform_maintenance(resource_group.name, VIRTUAL_MACHINE_NAME)
result = result.result()
except ResourceExistsError as e:
self.assertEquals(str(e), "(OperationNotAllowed) Operation 'performMaintenance' is not allowed on VM '%s' since the Subscription of this VM is not eligible." % (VIRTUAL_MACHINE_NAME))
self.assertEqual(str(e), "(OperationNotAllowed) Operation 'performMaintenance' is not allowed on VM '%s' since the Subscription of this VM is not eligible." % (VIRTUAL_MACHINE_NAME))

# VirtualMachine convert to managed disks (TODO: need swagger file)
try:
result = self.mgmt_client.virtual_machines.begin_convert_to_managed_disks(resource_group.name, VIRTUAL_MACHINE_NAME)
result = result.result()
except ResourceExistsError as e:
self.assertEquals(str(e), "(OperationNotAllowed) VM '%s' is already using managed disks." % (VIRTUAL_MACHINE_NAME))
self.assertEqual(str(e), "(OperationNotAllowed) VM '%s' is already using managed disks." % (VIRTUAL_MACHINE_NAME))

# TODO: Message: The Reimage and OSUpgrade Virtual Machine actions require that the virtual machine has Automatic OS Upgrades enabled.
# Reimage a Virtual Machine.[post]
Expand All @@ -381,7 +381,7 @@ def test_compute_vm_2(self, resource_group):
result = self.mgmt_client.virtual_machines.begin_reimage(resource_group.name, VIRTUAL_MACHINE_NAME)
result = result.result()
except ResourceExistsError as e:
self.assertEquals(str(e), "(OperationNotAllowed) The Reimage and OSUpgrade Virtual Machine actions require that the virtual machine has Automatic OS Upgrades enabled.")
self.assertEqual(str(e), "(OperationNotAllowed) The Reimage and OSUpgrade Virtual Machine actions require that the virtual machine has Automatic OS Upgrades enabled.")

# Delete virtual machine (TODO: need swagger file)
result = self.mgmt_client.virtual_machines.begin_delete(resource_group.name, VIRTUAL_MACHINE_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def create_virtual_hub(self, location, group_name, virtual_wan_name, virtual_hub
try:
result = result.result()
except HttpResponseError as e:
self.assertEquals(str(e), "(InternalServerError) An error occurred.")
self.assertEqual(str(e), "(InternalServerError) An error occurred.")
return result

def create_vm(self, group_name, location, vm_name, network_name, subnet_name, interface_name):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def test_get_access_control_with_match_conditions(self, datalake_storage_account
response = directory_client.get_access_control(etag=resp['etag'], match_condition=MatchConditions.IfNotModified)
# Assert
self.assertIsNotNone(response)
self.assertEquals(response['permissions'], 'rwxrwxrwx')
self.assertEqual(response['permissions'], 'rwxrwxrwx')

@DataLakePreparer()
def test_set_access_control_recursive(self, datalake_storage_account_name, datalake_storage_account_key):
Expand Down Expand Up @@ -937,7 +937,7 @@ def test_rename_to_an_existing_directory_in_another_file_system(self, datalake_s
with self.assertRaises(HttpResponseError):
source_directory_client.get_directory_properties()

self.assertEquals(res.url, destination_directory_client.url)
self.assertEqual(res.url, destination_directory_client.url)

@DataLakePreparer()
def test_rename_with_none_existing_destination_condition_and_source_unmodified_condition(self, datalake_storage_account_name, datalake_storage_account_key):
Expand Down Expand Up @@ -966,7 +966,7 @@ def test_rename_with_none_existing_destination_condition_and_source_unmodified_c
with self.assertRaises(HttpResponseError):
source_directory_client.get_directory_properties()

self.assertEquals(non_existing_dir_name, res.path_name)
self.assertEqual(non_existing_dir_name, res.path_name)

@DataLakePreparer()
def test_rename_to_an_non_existing_directory_in_another_file_system(self, datalake_storage_account_name, datalake_storage_account_key):
Expand All @@ -990,7 +990,7 @@ def test_rename_to_an_non_existing_directory_in_another_file_system(self, datala
with self.assertRaises(HttpResponseError):
source_directory_client.get_directory_properties()

self.assertEquals(non_existing_dir_name, res.path_name)
self.assertEqual(non_existing_dir_name, res.path_name)

@DataLakePreparer()
def test_rename_directory_to_non_empty_directory(self, datalake_storage_account_name, datalake_storage_account_key):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ async def test_get_access_control_with_match_conditions_async(self, datalake_sto
match_condition=MatchConditions.IfNotModified)
# Assert
self.assertIsNotNone(response)
self.assertEquals(response['permissions'], 'rwxrwxrwx')
self.assertEqual(response['permissions'], 'rwxrwxrwx')

@DataLakePreparer()
async def test_set_access_control_recursive_async(self, datalake_storage_account_name, datalake_storage_account_key):
Expand Down Expand Up @@ -903,7 +903,7 @@ async def test_rename_to_an_existing_directory_in_another_file_system_async(self
with self.assertRaises(HttpResponseError):
await source_directory_client.get_directory_properties()

self.assertEquals(res.url, destination_directory_client.url)
self.assertEqual(res.url, destination_directory_client.url)

@DataLakePreparer()
async def test_rename_with_none_existing_destination_condition_and_source_unmodified_condition_async(self, datalake_storage_account_name, datalake_storage_account_key):
Expand Down Expand Up @@ -934,7 +934,7 @@ async def test_rename_with_none_existing_destination_condition_and_source_unmodi
with self.assertRaises(HttpResponseError):
await source_directory_client.get_directory_properties()

self.assertEquals(non_existing_dir_name, res.path_name)
self.assertEqual(non_existing_dir_name, res.path_name)

@DataLakePreparer()
async def test_rename_to_an_non_existing_directory_in_another_file_system_async(self, datalake_storage_account_name, datalake_storage_account_key):
Expand All @@ -958,7 +958,7 @@ async def test_rename_to_an_non_existing_directory_in_another_file_system_async(
with self.assertRaises(HttpResponseError):
await source_directory_client.get_directory_properties()

self.assertEquals(non_existing_dir_name, res.path_name)
self.assertEqual(non_existing_dir_name, res.path_name)

@DataLakePreparer()
async def test_rename_directory_to_non_empty_directory_async(self, datalake_storage_account_name, datalake_storage_account_key):
Expand Down