Beispiel #1
0
 def test_session_for_tenant_id(self):
     """
     MimicCore.session_for_tenant_id will return a session that can be
     retrieved by tenant_id.
     """
     clock = Clock()
     core = MimicCore(clock, [])
     session = core.session_for_username_password("someuser", "testpass")
     session2 = core.session_for_tenant_id(session.tenant_id)
     self.assertIdentical(session, session2)
Beispiel #2
0
 def test_session_for_tenant_id(self):
     """
     MimicCore.session_for_tenant_id will return a session that can be
     retrieved by tenant_id.
     """
     clock = Clock()
     core = MimicCore(clock, [])
     session = core.session_for_username_password("someuser", "testpass")
     session2 = core.session_for_tenant_id(session.tenant_id)
     self.assertIdentical(session, session2)
Beispiel #3
0
 def test_generate_username_from_tenant_id(self):
     """
     MimicCore.session_for_tenant_id will create a new session with a
     synthetic username if no such tenant ID yet exists.
     """
     clock = Clock()
     core = MimicCore(clock, [])
     session = core.session_for_tenant_id("user_specified_tenant")
     session2 = core.session_for_username_password(session.username,
                                                   "testpass")
     self.assertIdentical(session, session2)
Beispiel #4
0
 def test_generate_username_from_tenant_id(self):
     """
     MimicCore.session_for_tenant_id will create a new session with a
     synthetic username if no such tenant ID yet exists.
     """
     clock = Clock()
     core = MimicCore(clock, [])
     session = core.session_for_tenant_id("user_specified_tenant")
     session2 = core.session_for_username_password(session.username,
                                                   "testpass")
     self.assertIdentical(session, session2)