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()))
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}
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))
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)
def tearDown(self): if not self.already_cleared: registry.del_exec_env(self.exec_key)