def update(self): """ Storing each attack records into __records in an instance of this class. An attack record is stored in there as an instance of RT class. """ global DB_RECORDS for e in DB_RECORDS: keys = list(e.keys()) if not "Name" in keys or not "Preconditions" in keys \ or not "Postconditions" in keys or not "Command" in keys: print("INVALID RECORD :\n" + str(e) + "\n") continue name = e["Name"] cond = Condition() for pre in e["Preconditions"]: cond.add(pre) post = e["Postconditions"] cmd = e["Command"] self.__records.append(RT(name, cond, post, cmd))
def setUp(self): #get the api key from the environment self.api = RT(os.getenv('API_KEY'))