summaryrefslogtreecommitdiff
path: root/trove/tests/unittests/datastore
diff options
context:
space:
mode:
authorValencia Serrao <vserrao@us.ibm.com>2017-11-22 15:49:27 +0530
committerValencia Serrao <vserrao@us.ibm.com>2017-12-06 18:24:06 +0530
commite2afdadb68a61ce111c5992b8912dff77bb7e658 (patch)
treee89c9498d0bf9c8f9b849ab5b9207cee791d2abd /trove/tests/unittests/datastore
parentccb6752f6973a7d1c8bb08675fde421710942998 (diff)
downloadtrove-e2afdadb68a61ce111c5992b8912dff77bb7e658.tar.gz
Replace assertRaisesRegexp with assertRaisesRegex
This replaces the deprecated (in python 3.2) unittest.TestCase method assertRaisesRegexp() with assertRaisesRegex() Added hacking rule 'assert_raises_regexp' Change-Id: Ie427bfd5af8474119a9e20cc025cd28abfa42cc2
Diffstat (limited to 'trove/tests/unittests/datastore')
-rw-r--r--trove/tests/unittests/datastore/test_datastore.py14
-rw-r--r--trove/tests/unittests/datastore/test_datastore_version_metadata.py4
2 files changed, 9 insertions, 9 deletions
diff --git a/trove/tests/unittests/datastore/test_datastore.py b/trove/tests/unittests/datastore/test_datastore.py
index a54a6768..2555fdab 100644
--- a/trove/tests/unittests/datastore/test_datastore.py
+++ b/trove/tests/unittests/datastore/test_datastore.py
@@ -36,13 +36,13 @@ class TestDatastore(TestDatastoreBase):
@patch.object(datastore_models, 'CONF')
def test_create_failure_with_datastore_default(self, mock_conf):
mock_conf.default_datastore = 'bad_ds'
- self.assertRaisesRegexp(exception.DatastoreDefaultDatastoreNotFound,
- "Default datastore 'bad_ds' cannot be found",
- datastore_models.get_datastore_version)
- self.assertRaisesRegexp(exception.DatastoreNotFound,
- "Datastore 'my_ds' cannot be found",
- datastore_models.get_datastore_version,
- 'my_ds')
+ self.assertRaisesRegex(exception.DatastoreDefaultDatastoreNotFound,
+ "Default datastore 'bad_ds' cannot be found",
+ datastore_models.get_datastore_version)
+ self.assertRaisesRegex(exception.DatastoreNotFound,
+ "Datastore 'my_ds' cannot be found",
+ datastore_models.get_datastore_version,
+ 'my_ds')
def test_get_datastore_or_version(self):
# datastore, datastore_version, valid, exception
diff --git a/trove/tests/unittests/datastore/test_datastore_version_metadata.py b/trove/tests/unittests/datastore/test_datastore_version_metadata.py
index d6346e84..5d028cc7 100644
--- a/trove/tests/unittests/datastore/test_datastore_version_metadata.py
+++ b/trove/tests/unittests/datastore/test_datastore_version_metadata.py
@@ -57,7 +57,7 @@ class TestDatastoreVersionMetadata(TestDatastoreBase):
def test_add_existing_flavor_associations(self):
dsmetadata = datastore_models.DatastoreVersionMetadata
- self.assertRaisesRegexp(
+ self.assertRaisesRegex(
exception.DatastoreFlavorAssociationAlreadyExists,
"Flavor %s is already associated with datastore %s version %s"
% (self.flavor_id, self.ds_name, self.ds_version),
@@ -73,7 +73,7 @@ class TestDatastoreVersionMetadata(TestDatastoreBase):
def test_delete_nonexistent_flavor_mapping(self):
dsmeta = datastore_models.DatastoreVersionMetadata
- self.assertRaisesRegexp(
+ self.assertRaisesRegex(
exception.DatastoreFlavorAssociationNotFound,
"Flavor 2 is not supported for datastore %s version %s"
% (self.ds_name, self.ds_version),