From 923926c48ea73c8377d54da6cfa277d49eeb12c9 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Tue, 8 Jan 2019 16:13:18 -0800 Subject: [PATCH] Deprecation warnings (#4136) * assertEqual * Packaging update of azure-cognitiveservices-language-textanalytics * Packaging update of azure-mgmt-web * Packaging update of azure-mgmt-search * Packaging update of azure-cognitiveservices-vision-face * Packaging update of azure-cognitiveservices-language-spellcheck * Packaging update of azure-mgmt-batchai * Update sdk_packaging.toml * Update sdk_packaging.toml * Packaging update of azure-cognitiveservices-language-spellcheck * Packaging update of azure-cognitiveservices-language-textanalytics * Update sdk_packaging.toml * Packaging update of azure-cognitiveservices-vision-face * Update test_mgmt_containerservice.py --- .../MANIFEST.in | 4 ++++ .../sdk_packaging.toml | 1 + .../tests/test_spell_check.py | 4 ++-- .../MANIFEST.in | 4 ++++ .../sdk_packaging.toml | 1 + .../tests/test_text_analytics.py | 2 +- .../tests/test_face.py | 6 +++--- azure-mgmt-batchai/MANIFEST.in | 3 +++ azure-mgmt-batchai/tests/helpers.py | 4 ++-- .../tests/test_mgmt_containerservice.py | 2 -- azure-mgmt-network/tests/test_mgmt_network.py | 2 +- azure-mgmt-search/MANIFEST.in | 3 +++ azure-mgmt-search/tests/test_mgmt_search.py | 18 +++++++++--------- azure-mgmt-sql/tests/test_mgmt_sql.py | 6 +++--- azure-mgmt-web/MANIFEST.in | 3 +++ azure-mgmt-web/tests/test_mgmt_web.py | 2 +- 16 files changed, 41 insertions(+), 24 deletions(-) diff --git a/azure-cognitiveservices-language-spellcheck/MANIFEST.in b/azure-cognitiveservices-language-spellcheck/MANIFEST.in index bb37a2723dae..7f728a95d094 100644 --- a/azure-cognitiveservices-language-spellcheck/MANIFEST.in +++ b/azure-cognitiveservices-language-spellcheck/MANIFEST.in @@ -1 +1,5 @@ include *.rst +include azure/__init__.py +include azure/cognitiveservices/__init__.py +include azure/cognitiveservices/language/__init__.py + diff --git a/azure-cognitiveservices-language-spellcheck/sdk_packaging.toml b/azure-cognitiveservices-language-spellcheck/sdk_packaging.toml index 6a638b7c31ef..9f99eefe4a74 100644 --- a/azure-cognitiveservices-language-spellcheck/sdk_packaging.toml +++ b/azure-cognitiveservices-language-spellcheck/sdk_packaging.toml @@ -5,3 +5,4 @@ package_pprint_name = "Cognitive Services Spellcheck" package_doc_id = "cognitive-services" is_stable = true is_arm = false +need_msrestazure = false diff --git a/azure-cognitiveservices-language-spellcheck/tests/test_spell_check.py b/azure-cognitiveservices-language-spellcheck/tests/test_spell_check.py index fa39c005b9ed..a64a47964ca4 100644 --- a/azure-cognitiveservices-language-spellcheck/tests/test_spell_check.py +++ b/azure-cognitiveservices-language-spellcheck/tests/test_spell_check.py @@ -49,8 +49,8 @@ def test_spell_check(self): response = text_analytics.spell_checker( "cognituve services" ) - self.assertEquals(response.flagged_tokens[0].token, "cognituve") - self.assertEquals(response.flagged_tokens[0].suggestions[0].suggestion, "cognitive") + self.assertEqual(response.flagged_tokens[0].token, "cognituve") + self.assertEqual(response.flagged_tokens[0].suggestions[0].suggestion, "cognitive") diff --git a/azure-cognitiveservices-language-textanalytics/MANIFEST.in b/azure-cognitiveservices-language-textanalytics/MANIFEST.in index bb37a2723dae..7f728a95d094 100644 --- a/azure-cognitiveservices-language-textanalytics/MANIFEST.in +++ b/azure-cognitiveservices-language-textanalytics/MANIFEST.in @@ -1 +1,5 @@ include *.rst +include azure/__init__.py +include azure/cognitiveservices/__init__.py +include azure/cognitiveservices/language/__init__.py + diff --git a/azure-cognitiveservices-language-textanalytics/sdk_packaging.toml b/azure-cognitiveservices-language-textanalytics/sdk_packaging.toml index 8e4a121a7f7c..4ea485ef8c80 100644 --- a/azure-cognitiveservices-language-textanalytics/sdk_packaging.toml +++ b/azure-cognitiveservices-language-textanalytics/sdk_packaging.toml @@ -5,3 +5,4 @@ package_pprint_name = "Cognitive Services Text Analytics" package_doc_id = "cognitive-services" is_stable = false is_arm = false +need_msrestazure = false diff --git a/azure-cognitiveservices-language-textanalytics/tests/test_text_analytics.py b/azure-cognitiveservices-language-textanalytics/tests/test_text_analytics.py index 792a20e9481e..793487178ab3 100644 --- a/azure-cognitiveservices-language-textanalytics/tests/test_text_analytics.py +++ b/azure-cognitiveservices-language-textanalytics/tests/test_text_analytics.py @@ -53,6 +53,6 @@ def test_detect_language(self): }] ) - self.assertEquals(response.documents[0].detected_languages[0].name, "English") + self.assertEqual(response.documents[0].detected_languages[0].name, "English") diff --git a/azure-cognitiveservices-vision-face/tests/test_face.py b/azure-cognitiveservices-vision-face/tests/test_face.py index 0821ec48e2cf..b8c984010a6b 100644 --- a/azure-cognitiveservices-vision-face/tests/test_face.py +++ b/azure-cognitiveservices-vision-face/tests/test_face.py @@ -56,6 +56,6 @@ def test_face_detect(self): ) detected = result[0] - self.assertEquals(detected.face_attributes.age, 52.4) - self.assertEquals(detected.face_attributes.gender, Gender.female) - self.assertEquals(detected.face_attributes.emotion.happiness, 1.0) + self.assertEqual(detected.face_attributes.age, 52.4) + self.assertEqual(detected.face_attributes.gender, Gender.female) + self.assertEqual(detected.face_attributes.emotion.happiness, 1.0) diff --git a/azure-mgmt-batchai/MANIFEST.in b/azure-mgmt-batchai/MANIFEST.in index bb37a2723dae..6ceb27f7a96e 100644 --- a/azure-mgmt-batchai/MANIFEST.in +++ b/azure-mgmt-batchai/MANIFEST.in @@ -1 +1,4 @@ include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-batchai/tests/helpers.py b/azure-mgmt-batchai/tests/helpers.py index 9ab0eb1ca356..68e3537b4f11 100644 --- a/azure-mgmt-batchai/tests/helpers.py +++ b/azure-mgmt-batchai/tests/helpers.py @@ -385,7 +385,7 @@ def assert_job_files_in_path_are(test, client, resource_group, job_name, output_ if f.file_type == models.FileType.file: v = requests.get(f.download_url).content actual[f.name] = v if isinstance(v, six.string_types) else v.decode() - test.assertEquals(sorted(actual.keys()), sorted(expected.keys())) + test.assertEqual(sorted(actual.keys()), sorted(expected.keys())) for k, v in expected.items(): a = actual[k] if a is None and v is None: @@ -396,7 +396,7 @@ def assert_job_files_in_path_are(test, client, resource_group, job_name, output_ if a is None: test.fail('Expected {0} to be a file, got a directory'.format(k)) if isinstance(v, six.string_types): - test.assertEquals(v, a, k + "expected {0} got {1}".format(v, a)) + test.assertEqual(v, a, k + "expected {0} got {1}".format(v, a)) else: test.assertRegexpMatches(actual.get(k), v, k) if output_directory_id == Helpers.STANDARD_OUTPUT_DIRECTORY_ID and not execution_log_found: diff --git a/azure-mgmt-containerservice/tests/test_mgmt_containerservice.py b/azure-mgmt-containerservice/tests/test_mgmt_containerservice.py index c41f05e6854d..f670450f41bc 100644 --- a/azure-mgmt-containerservice/tests/test_mgmt_containerservice.py +++ b/azure-mgmt-containerservice/tests/test_mgmt_containerservice.py @@ -24,7 +24,6 @@ def setUp(self): def test_container(self, resource_group, location): container_name = self.get_resource_name('pycontainer') - # https://msdn.microsoft.com/en-us/library/azure/mt711471.aspx async_create = self.cs_client.container_services.create_or_update( resource_group.name, container_name, @@ -53,7 +52,6 @@ def test_container(self, resource_group, location): } }, }, - retries=0 ) container = async_create.result() diff --git a/azure-mgmt-network/tests/test_mgmt_network.py b/azure-mgmt-network/tests/test_mgmt_network.py index c87b37cba1a6..ec34fb53e121 100644 --- a/azure-mgmt-network/tests/test_mgmt_network.py +++ b/azure-mgmt-network/tests/test_mgmt_network.py @@ -685,7 +685,7 @@ def test_virtual_network_gateway_operations(self, resource_group, location): gw_params ) vng = async_create.result() - self.assertEquals(vng.name, vng_name) + self.assertEqual(vng.name, vng_name) #------------------------------------------------------------------------------ diff --git a/azure-mgmt-search/MANIFEST.in b/azure-mgmt-search/MANIFEST.in index bb37a2723dae..6ceb27f7a96e 100644 --- a/azure-mgmt-search/MANIFEST.in +++ b/azure-mgmt-search/MANIFEST.in @@ -1 +1,4 @@ include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-search/tests/test_mgmt_search.py b/azure-mgmt-search/tests/test_mgmt_search.py index f957df08dccf..d07827b81316 100644 --- a/azure-mgmt-search/tests/test_mgmt_search.py +++ b/azure-mgmt-search/tests/test_mgmt_search.py @@ -42,22 +42,22 @@ def test_search_services(self, resource_group, location): availability = self.client.services.check_name_availability(account_name) self.assertFalse(availability.is_name_available) - self.assertEquals(availability.reason, "AlreadyExists") + self.assertEqual(availability.reason, "AlreadyExists") service = self.client.services.get( resource_group.name, service.name ) - self.assertEquals(service.name, account_name) + self.assertEqual(service.name, account_name) services = list(self.client.services.list_by_resource_group(resource_group.name)) - self.assertEquals(len(services), 1) - self.assertEquals(services[0].name, account_name) + self.assertEqual(len(services), 1) + self.assertEqual(services[0].name, account_name) self.client.services.delete( resource_group.name, service.name - ) + ) @ResourceGroupPreparer() def test_search_query_keys(self, resource_group, location): @@ -83,15 +83,15 @@ def test_search_query_keys(self, resource_group, location): account_name, key_name, ) - self.assertEquals(key.name, key_name) + self.assertEqual(key.name, key_name) keys = list(self.client.query_keys.list_by_search_service( resource_group.name, account_name )) - self.assertEquals(len(keys), 2) # default key and mine + self.assertEqual(len(keys), 2) # default key and mine self.assertIsNone(keys[0].name) - self.assertEquals(keys[1].name, key_name) + self.assertEqual(keys[1].name, key_name) self.client.query_keys.delete( resource_group.name, @@ -130,7 +130,7 @@ def test_search_admin_keys(self, resource_group, location): 'primary' ) self.assertIsNotNone(regenerated_admin_keys.primary_key) - self.assertEquals(admin_keys.secondary_key, regenerated_admin_keys.secondary_key) + self.assertEqual(admin_keys.secondary_key, regenerated_admin_keys.secondary_key) #------------------------------------------------------------------------------ if __name__ == '__main__': diff --git a/azure-mgmt-sql/tests/test_mgmt_sql.py b/azure-mgmt-sql/tests/test_mgmt_sql.py index c5caca315a42..f043d04ad5dc 100644 --- a/azure-mgmt-sql/tests/test_mgmt_sql.py +++ b/azure-mgmt-sql/tests/test_mgmt_sql.py @@ -89,9 +89,9 @@ def test_server(self, resource_group, location): "123.123.123.123", "123.123.123.124" ) - self.assertEquals(firewall_rule.name, firewall_rule_name) - self.assertEquals(firewall_rule.start_ip_address, "123.123.123.123") - self.assertEquals(firewall_rule.end_ip_address, "123.123.123.124") + self.assertEqual(firewall_rule.name, firewall_rule_name) + self.assertEqual(firewall_rule.start_ip_address, "123.123.123.123") + self.assertEqual(firewall_rule.end_ip_address, "123.123.123.124") self.client.servers.delete(resource_group.name, server_name, polling=False) diff --git a/azure-mgmt-web/MANIFEST.in b/azure-mgmt-web/MANIFEST.in index bb37a2723dae..6ceb27f7a96e 100644 --- a/azure-mgmt-web/MANIFEST.in +++ b/azure-mgmt-web/MANIFEST.in @@ -1 +1,4 @@ include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-web/tests/test_mgmt_web.py b/azure-mgmt-web/tests/test_mgmt_web.py index 1847f61120d4..eb0e51867e6b 100644 --- a/azure-mgmt-web/tests/test_mgmt_web.py +++ b/azure-mgmt-web/tests/test_mgmt_web.py @@ -49,7 +49,7 @@ def test_webapp(self, resource_group, location): ) ) site = site_async_operation.result() - self.assertEquals(site.name, site_name) + self.assertEqual(site.name, site_name) # List Sites by Resource Group for site in self.web_client.sites.get_sites(self.group_name):