diff options
author | yanheven <yanheven@qq.com> | 2016-07-23 16:50:42 +0800 |
---|---|---|
committer | yanheven <yanheven@qq.com> | 2016-07-23 17:00:31 +0800 |
commit | 10fd6fd30a6ed7ab3b98c7ef318fe93f1f144243 (patch) | |
tree | 68861ca81793e0e1b32f2e5e5359949c5a097852 /oslo_context | |
parent | 932b4950770782fbbf64828f5a824aa752fc0dd7 (diff) | |
download | oslo-context-10fd6fd30a6ed7ab3b98c7ef318fe93f1f144243.tar.gz |
Fix parameters of assertEqual are misplaced
Many assertEqual sentences don't follow assertEqual(expected, actual),
These misplaces have 2 impacts:
1, giving confusing messages when some tests failed.
2, mislead other developers, new test modules may follow these wrong pattern.
This patch fix all of them.
Change-Id: I806c893fd46242b021ce90037609ee47e015e1f3
Closes-Bug: #1604213
Diffstat (limited to 'oslo_context')
-rw-r--r-- | oslo_context/tests/test_context.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/oslo_context/tests/test_context.py b/oslo_context/tests/test_context.py index 54046cb..2588fa0 100644 --- a/oslo_context/tests/test_context.py +++ b/oslo_context/tests/test_context.py @@ -227,27 +227,27 @@ class ContextTest(test_base.BaseTestCase): 'HTTP_X_USER_ID': new} ctx = context.RequestContext.from_environ(environ=environ) - self.assertEqual(ctx.user, new) + self.assertEqual(new, ctx.user) ctx = context.RequestContext.from_environ(environ=environ, user=override) - self.assertEqual(ctx.user, override) + self.assertEqual(override, ctx.user) environ = {'HTTP_X_TENANT': old, 'HTTP_X_PROJECT_ID': new} ctx = context.RequestContext.from_environ(environ=environ) - self.assertEqual(ctx.tenant, new) + self.assertEqual(new, ctx.tenant) ctx = context.RequestContext.from_environ(environ=environ, tenant=override) - self.assertEqual(ctx.tenant, override) + self.assertEqual(override, ctx.tenant) environ = {'HTTP_X_TENANT_NAME': old, 'HTTP_X_PROJECT_NAME': new} ctx = context.RequestContext.from_environ(environ=environ) - self.assertEqual(ctx.project_name, new) + self.assertEqual(new, ctx.project_name) def test_from_environ_strip_roles(self): environ = {'HTTP_X_ROLES': ' abc\t,\ndef\n,ghi\n\n'} |