def testResetNotEmptySid(self): register(1, "sid-1") register(2, "sid-1") resp = query("sid-1") self.assertEqual(len(resp["data"]), 2) resetSid("sid-1") resp = query("sid-1") self.assertEqual(len(resp["data"]), 0)
def testResetPersistence(self): register(1, "sid-1") register(2, "sid-2") resetSid("sid-1") resp = query("sid-1") self.assertEqual(len(resp["data"]), 0) resp = query("sid-2") self.assertEqual(len(resp["data"]), 1) exitServer() time.sleep(0.5) resp = query("sid-1") self.assertEqual(len(resp["data"]), 0) resp = query("sid-2") self.assertEqual(len(resp["data"]), 1)
def testResetExistSidResponse(self): register(1, "sid-1") resp = resetSid("sid-1") self.assertEqual(resp["success"], "true")
def setUp(self): resetSid("sid-1")
def testResetNotExistSid(self): resp = resetSid("sid-1234") self.assertEqual(resp["success"], "true")