Esempio n. 1
0
 def test_removeNonexistentSession(self):
     """
     L{PersistentSessionWrapper.removeSessionWithKey} does nothing if the
     session does not exist.
     """
     store = Store()
     resource = PersistentSessionWrapper(store, None)
     resource.removeSessionWithKey(b'key')
Esempio n. 2
0
 def test_removeNonexistentSession(self):
     """
     L{PersistentSessionWrapper.removeSessionWithKey} does nothing if the
     session does not exist.
     """
     store = Store()
     resource = PersistentSessionWrapper(store, None)
     resource.removeSessionWithKey(b'key')
Esempio n. 3
0
 def test_removeSession(self):
     """
     L{PersistentSessionWrapper.removeSessionWithKey} removes an existing
     session with the given key.
     """
     store = Store()
     resource = PersistentSessionWrapper(store, None)
     resource.createSessionForKey(b'key', b'username@domain')
     self.assertEqual(store.query(PersistentSession).count(), 1)
     resource.removeSessionWithKey(b'key')
     self.assertEqual(store.query(PersistentSession).count(), 0)
Esempio n. 4
0
 def test_removeSession(self):
     """
     L{PersistentSessionWrapper.removeSessionWithKey} removes an existing
     session with the given key.
     """
     store = Store()
     resource = PersistentSessionWrapper(store, None)
     resource.createSessionForKey(b'key', b'username@domain')
     self.assertEqual(store.query(PersistentSession).count(), 1)
     resource.removeSessionWithKey(b'key')
     self.assertEqual(store.query(PersistentSession).count(), 0)