Merge "Flip to pythonic method names for context unit tests"
This commit is contained in:
commit
18fe2ac603
@ -30,20 +30,18 @@ class TestNeutronContext(base.BaseTestCase):
|
|||||||
self.db_api_session = self._db_api_session_patcher.start()
|
self.db_api_session = self._db_api_session_patcher.start()
|
||||||
self.addCleanup(self._db_api_session_patcher.stop)
|
self.addCleanup(self._db_api_session_patcher.stop)
|
||||||
|
|
||||||
# TODO(salv-orlando): Remove camelcase for test names in this module
|
def test_neutron_context_create(self):
|
||||||
|
|
||||||
def testNeutronContextCreate(self):
|
|
||||||
cxt = context.Context('user_id', 'tenant_id')
|
cxt = context.Context('user_id', 'tenant_id')
|
||||||
self.assertEqual('user_id', cxt.user_id)
|
self.assertEqual('user_id', cxt.user_id)
|
||||||
self.assertEqual('tenant_id', cxt.project_id)
|
self.assertEqual('tenant_id', cxt.project_id)
|
||||||
|
|
||||||
def testNeutronContextToDict(self):
|
def test_neutron_context_to_dict(self):
|
||||||
cxt = context.Context('user_id', 'tenant_id')
|
cxt = context.Context('user_id', 'tenant_id')
|
||||||
cxt_dict = cxt.to_dict()
|
cxt_dict = cxt.to_dict()
|
||||||
self.assertEqual('user_id', cxt_dict['user_id'])
|
self.assertEqual('user_id', cxt_dict['user_id'])
|
||||||
self.assertEqual('tenant_id', cxt_dict['project_id'])
|
self.assertEqual('tenant_id', cxt_dict['project_id'])
|
||||||
|
|
||||||
def testNeutronContextAdminToDict(self):
|
def test_neutron_context_admin_to_dict(self):
|
||||||
self.db_api_session.return_value = 'fakesession'
|
self.db_api_session.return_value = 'fakesession'
|
||||||
cxt = context.get_admin_context()
|
cxt = context.get_admin_context()
|
||||||
cxt_dict = cxt.to_dict()
|
cxt_dict = cxt.to_dict()
|
||||||
@ -52,7 +50,7 @@ class TestNeutronContext(base.BaseTestCase):
|
|||||||
self.assertIsNotNone(cxt.session)
|
self.assertIsNotNone(cxt.session)
|
||||||
self.assertFalse('session' in cxt_dict)
|
self.assertFalse('session' in cxt_dict)
|
||||||
|
|
||||||
def testNeutronContextAdminWithoutSessionToDict(self):
|
def test_neutron_context_admin_without_session_to_dict(self):
|
||||||
cxt = context.get_admin_context_without_session()
|
cxt = context.get_admin_context_without_session()
|
||||||
cxt_dict = cxt.to_dict()
|
cxt_dict = cxt.to_dict()
|
||||||
self.assertIsNone(cxt_dict['user_id'])
|
self.assertIsNone(cxt_dict['user_id'])
|
||||||
|
Loading…
Reference in New Issue
Block a user