Esempio n. 1
0
 def test1(self):
     db = SqlDb(DB_URI)
     cs = KvSqlChallengeStore(db)
     
     t1 = cs.timestamp("somechallenge")
     self.assertIsNone(t1)
     
     t2 = datetime.datetime.now()
     cs.store("somechallenge", t2)
     
     t3 = cs.timestamp("somechallenge")
     self.assertEqual(t2.timetuple(), t3.timetuple())
Esempio n. 2
0
 def test2(self):
     db = SqlDb(DB_URI)
     cs = KvSqlChallengeStore(db)
     
     t = cs.timestamp("non-existing-challenge")
     self.assertIsNone(t)
     
     cs.store("non-existing-challenge", datetime.datetime.now())
     t = cs.timestamp("non-existing-challenge")
     self.assertIsNotNone(t)
     
     cs.purge("non-existing-challenge")
     t = cs.timestamp("non-existing-challenge")
     self.assertIsNone(t)