コード例 #1
0
ファイル: SignalTest.py プロジェクト: hungnt1/evio
 def testjid_cache_scavenge(self):
     """
     Test to check the scavenge method of the jid-cache of the signal class.
     """
     sig_dict, signal = self.setup_vars_mocks()
     jid_cache = JidCache(signal, 5)
     jid_cache.add_entry("123", "2345")
     assert jid_cache.lookup("123") == "2345"
     sleep(5)
     jid_cache.scavenge()
     assert jid_cache.lookup("123") is None
     print("Passed : testjid_cache_scavenge")
コード例 #2
0
ファイル: SignalTest.py プロジェクト: hungnt1/evio
 def testjid_cache_add_lookup_entry(self):
     """
     Test to check the lookup method of the jid-cache of the signal class.
     """
     sig_dict, signal = self.setup_vars_mocks()
     jid_cache = JidCache(signal, 30)
     jid_cache.add_entry("123", "2345")
     assert jid_cache.lookup("123") == "2345"
     print("Passed : testjid_cache_add_lookup_entry")