예제 #1
0
 def test_del_exec_env(self, dump, load):
     registry[self.exec_key]["name"] = "Abhinav"
     registry.save_reg(self.exec_key)
     registry.del_exec_env(self.exec_key)
     self.already_cleared = True
     self.assertRaises(KeyError, registry.del_exec_env, self.exec_key)
     self.assertTrue(not os.path.exists(self.get_action_pkl_file()))
예제 #2
0
 def delete(self, exec_key):
     print("Clearing registry for key - {}".format(exec_key))
     try:
         registry.del_exec_env(exec_key)
     except KeyError:
         return err_return(
             "Key - {} does not exist in registry".format(exec_key))
     return {'success': True}
예제 #3
0
 def tearDown(self):
     if not self.already_cleared:
         registry.del_exec_env(self.exec_key)
     print(f"rm {registry.db_dir}/*json")
     os.system(f"rm {registry.db_dir}/*json")
     pkl_file = self.get_action_pkl_file()
     self.test_agent = None
     self.assertTrue(not os.path.exists(pkl_file))
예제 #4
0
 def test_del_exec_env(self, dump, load):
     registry[self.exec_key]["name"] = "Abhinav"
     registry.save_reg(self.exec_key)
     registry.del_exec_env(self.exec_key)
     self.already_cleared = True
     self.assertRaises(KeyError, registry.del_exec_env, self.exec_key)
예제 #5
0
 def tearDown(self):
     if not self.already_cleared:
         registry.del_exec_env(self.exec_key)