Beispiel #1
0
 def test_remove_old(self):
     m = MemorySession(timeout=timedelta(milliseconds=1),
                       delete_interval=timedelta(milliseconds=1))
     sid = "xxyA"
     m.save(sid, dict(name="John", age=20))
     sleep(0.1)
     self.assertRaises(NoSuchSessionError, m.load, sid)
Beispiel #2
0
	def test_remove_old(self):
		m = MemorySession(timeout=timedelta(milliseconds=1),
				delete_interval=timedelta(milliseconds=1))
		sid = "xxyA"
		m.save(sid, dict(name="John", age=20))
		sleep(0.1)
		self.assertRaises(NoSuchSessionError, m.load, sid)
Beispiel #3
0
 def test_load_save(self):
     ms = MemorySession()
     sid = ms.generate_sid()
     ms.save(sid, dict(name="John", age=20))
     session = ms.load(sid)
     self.assertEquals(session["name"], "John")
Beispiel #4
0
	def test_load_save(self):
		ms = MemorySession()
		sid = ms.generate_sid()
		ms.save(sid, dict(name="John", age=20))
		session = ms.load(sid)
		self.assertEquals(session["name"], "John")