示例#1
0
 def test_retrieveNonexistentSession(self):
     """
     L{PersistentSessionWrapper.authenticatedUserForKey} returns C{None} if
     a session does not exist.
     """
     store = Store()
     resource = PersistentSessionWrapper(store, None)
     user = resource.authenticatedUserForKey(b'doesnotexist')
     self.assertIdentical(user, None)
示例#2
0
 def test_retrieveNonexistentSession(self):
     """
     L{PersistentSessionWrapper.authenticatedUserForKey} returns C{None} if
     a session does not exist.
     """
     store = Store()
     resource = PersistentSessionWrapper(store, None)
     user = resource.authenticatedUserForKey(b'doesnotexist')
     self.assertIdentical(user, None)
示例#3
0
 def test_retrieveSession(self):
     """
     L{PersistentSessionWrapper.authenticatedUserForKey} returns the user to
     whom a session belongs.
     """
     store = Store()
     resource = PersistentSessionWrapper(store, None)
     resource.createSessionForKey(b'key', b'username@domain')
     user = resource.authenticatedUserForKey(b'key')
     self.assertEqual(user, b'username@domain')
示例#4
0
 def test_retrieveSession(self):
     """
     L{PersistentSessionWrapper.authenticatedUserForKey} returns the user to
     whom a session belongs.
     """
     store = Store()
     resource = PersistentSessionWrapper(store, None)
     resource.createSessionForKey(b'key', b'username@domain')
     user = resource.authenticatedUserForKey(b'key')
     self.assertEqual(user, b'username@domain')