diff options
author | Zuul <zuul@review.openstack.org> | 2018-09-26 12:40:22 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2018-09-26 12:40:22 +0000 |
commit | 28e8e72bf4a49c360bbe80591d5e01fc6bb92c1a (patch) | |
tree | 00bf9048463acfc427cfaa20e72402f69c404dd2 | |
parent | 298588436245883d1563103abdc0b0d11a23f762 (diff) | |
parent | 78946925b66070a63365402223f08439ddcce2b5 (diff) | |
download | python-troveclient-28e8e72bf4a49c360bbe80591d5e01fc6bb92c1a.tar.gz |
Merge "Replace assertRaisesRegexp with assertRaisesRegex"
-rw-r--r-- | troveclient/tests/test_client.py | 4 | ||||
-rw-r--r-- | troveclient/tests/test_v1_shell.py | 22 |
2 files changed, 13 insertions, 13 deletions
diff --git a/troveclient/tests/test_client.py b/troveclient/tests/test_client.py index 0d858d4..e3682bd 100644 --- a/troveclient/tests/test_client.py +++ b/troveclient/tests/test_client.py @@ -44,7 +44,7 @@ class ClientTest(testtools.TestCase): '0', version_map) def test_client_with_auth_system_without_auth_plugin(self): - self.assertRaisesRegexp( + self.assertRaisesRegex( exceptions.AuthSystemNotFound, "AuthSystemNotFound: 'something'", other_client.HTTPClient, user='user', password='password', projectid='project', timeout=2, auth_url="http://www.blah.com", @@ -147,7 +147,7 @@ class ClientTest(testtools.TestCase): mock_request.side_effect = requests.exceptions.ConnectionError( 'connection refused') with mock.patch('requests.request', mock_request): - self.assertRaisesRegexp( + self.assertRaisesRegex( exceptions.ClientException, 'Unable to establish connection: connection refused', instance.get, '/instances') diff --git a/troveclient/tests/test_v1_shell.py b/troveclient/tests/test_v1_shell.py index eb18e48..f15c599 100644 --- a/troveclient/tests/test_v1_shell.py +++ b/troveclient/tests/test_v1_shell.py @@ -223,7 +223,7 @@ class ShellTest(utils.TestCase): cmd = 'flavor-list --datastore_type mysql' exepcted_error_msg = ('Missing argument\(s\): ' 'datastore_type, datastore_version_id') - self.assertRaisesRegexp( + self.assertRaisesRegex( exceptions.MissingArgs, exepcted_error_msg, self.run_command, cmd) @@ -258,7 +258,7 @@ class ShellTest(utils.TestCase): cmd = 'volume-type-list --datastore_type mysql' exepcted_error_msg = ('Missing argument\(s\): ' 'datastore_type, datastore_version_id') - self.assertRaisesRegexp( + self.assertRaisesRegex( exceptions.MissingArgs, exepcted_error_msg, self.run_command, cmd) @@ -390,7 +390,7 @@ class ShellTest(utils.TestCase): def test_boot_locality_error(self): cmd = ('create slave-1 1 --size 1 --locality=affinity ' '--replica_of=master_1') - self.assertRaisesRegexp( + self.assertRaisesRegex( exceptions.ValidationError, 'Cannot specify locality when adding replicas to existing ' 'master.', @@ -399,7 +399,7 @@ class ShellTest(utils.TestCase): def test_boot_nic_error(self): cmd = ('create test-member-1 1 --size 1 --volume_type lvm ' '--nic net-id=some-id,port-id=some-id') - self.assertRaisesRegexp( + self.assertRaisesRegex( exceptions.ValidationError, 'Invalid NIC argument: nic=\'net-id=some-id,port-id=some-id\'', self.run_command, cmd) @@ -474,7 +474,7 @@ class ShellTest(utils.TestCase): def test_cluster_create_error(self): cmd = ('cluster-create test-clstr vertica 7.1 --instance volume=2 ' '--instance flavor=2,volume=1') - self.assertRaisesRegexp( + self.assertRaisesRegex( exceptions.MissingArgs, "Missing option 'flavor'", self.run_command, cmd) @@ -592,7 +592,7 @@ class ShellTest(utils.TestCase): 'port-id=some-port-id,availability_zone=2 ' '--instance flavor=2,volume=1,nic=net-id=some-id,' 'port-id=some-port-id,availability_zone=2') - self.assertRaisesRegexp( + self.assertRaisesRegex( exceptions.ValidationError, "Invalid 'nic' option. " "The value must be quoted.", self.run_command, cmd) @@ -603,7 +603,7 @@ class ShellTest(utils.TestCase): 'availability_zone=2 ' '--instance flavor=2,volume=1,nic=\'v4-fixed-ip=10.0.0.1\',' 'availability_zone=2') - self.assertRaisesRegexp( + self.assertRaisesRegex( exceptions.ValidationError, 'Invalid NIC argument', self.run_command, cmd) @@ -626,9 +626,9 @@ class ShellTest(utils.TestCase): def test_datastore_version_show_error(self): expected_error_msg = ('The datastore name or id is required to ' 'retrieve a datastore version by name.') - self.assertRaisesRegexp(exceptions.NoUniqueMatch, expected_error_msg, - self.run_command, - 'datastore-version-show v-56') + self.assertRaisesRegex(exceptions.NoUniqueMatch, expected_error_msg, + self.run_command, + 'datastore-version-show v-56') def test_configuration_list(self): self.run_command('configuration-list') @@ -660,7 +660,7 @@ class ShellTest(utils.TestCase): expected_error_msg = ('The datastore name or id is required to ' 'retrieve the parameters for the configuration ' 'group by name') - self.assertRaisesRegexp( + self.assertRaisesRegex( exceptions.NoUniqueMatch, expected_error_msg, self.run_command, 'configuration-parameter-list v-156') |