diff options
author | Takashi Natsume <takanattie@gmail.com> | 2022-08-20 13:04:05 +0900 |
---|---|---|
committer | Takashi Natsume <takanattie@gmail.com> | 2022-10-15 12:42:46 +0000 |
commit | 8c94e21196756c0a799dfafb42cbcf4ad96109f6 (patch) | |
tree | dc495ef292b28fab380a2d86f657a10f8f344eb3 /trove/tests/unittests/common/test_context.py | |
parent | 346e1612200563cdbeadc49186fd819dc6d4f950 (diff) | |
download | trove-8c94e21196756c0a799dfafb42cbcf4ad96109f6.tar.gz |
Fix deprecation warnings
Fix the following deprecation warnings.
* DeprecationWarning: Using the 'user' argument is deprecated
in version '2.18' and will be removed in version '3.0',
please use the 'user_id' argument instead
* DeprecationWarning: Property 'user' has moved to 'user_id'
in version '2.6' and will be removed in version '3.0'
Change-Id: I18802ae1e2318eae3c62a26459178b259c728ac4
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Diffstat (limited to 'trove/tests/unittests/common/test_context.py')
-rw-r--r-- | trove/tests/unittests/common/test_context.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/trove/tests/unittests/common/test_context.py b/trove/tests/unittests/common/test_context.py index a5f2f3a2..16df1f6b 100644 --- a/trove/tests/unittests/common/test_context.py +++ b/trove/tests/unittests/common/test_context.py @@ -24,7 +24,7 @@ from trove.tests.unittests import trove_testtools class TestTroveContext(trove_testtools.TestCase): def test_create_with_extended_args(self): expected_service_catalog = {'key': 'value'} - ctx = context.TroveContext(user="test_user_id", + ctx = context.TroveContext(user_id="test_user_id", request_id="test_req_id", limit="500", marker="x", @@ -34,23 +34,23 @@ class TestTroveContext(trove_testtools.TestCase): self.assertThat(ctx.service_catalog, Equals(expected_service_catalog)) def test_create(self): - ctx = context.TroveContext(user='test_user_id', + ctx = context.TroveContext(user_id='test_user_id', request_id='test_req_id') - self.assertThat(ctx.user, Equals('test_user_id')) + self.assertThat(ctx.user_id, Equals('test_user_id')) self.assertThat(ctx.request_id, Equals('test_req_id')) self.assertThat(ctx.limit, Is(None)) self.assertThat(ctx.marker, Is(None)) self.assertThat(ctx.service_catalog, Is(None)) def test_to_dict(self): - ctx = context.TroveContext(user='test_user_id', + ctx = context.TroveContext(user_id='test_user_id', request_id='test_req_id') ctx_dict = ctx.to_dict() self.assertThat(ctx_dict.get('user'), Equals('test_user_id')) self.assertThat(ctx_dict.get('request_id'), Equals('test_req_id')) def test_to_dict_with_notification(self): - ctx = context.TroveContext(user='test_user_id', + ctx = context.TroveContext(user_id='test_user_id', project_id='the_tenant', request_id='test_req_id') ctx.notification = DBaaSInstanceCreate(ctx, @@ -70,7 +70,7 @@ class TestTroveContext(trove_testtools.TestCase): 'request_id': 'test_req_id', 'project_id': 'abc', 'blah_blah': 'blah blah'}) - self.assertThat(ctx.user, Equals('test_user_id')) + self.assertThat(ctx.user_id, Equals('test_user_id')) self.assertThat(ctx.request_id, Equals('test_req_id')) self.assertThat(ctx.project_id, Equals('abc')) self.assertThat(ctx.limit, Is(None)) |