class TestReadConfig(unittest.TestCase): def setUp(self): self.directory_path = os.path.dirname(os.path.abspath('__file__')) self.rcfg = ReadConfig(self.directory_path + '/config.yaml') def test_get_config_keys(self): self._keys = ['author', 'contact', 'title', 'social', 'theme'].sort() self.assertEqual(self._keys, self.rcfg.get_config_keys().sort())
def setUp(self): self.directory_path = os.path.dirname(os.path.abspath('__file__')) self.rcfg = ReadConfig(self.directory_path + '/config.yaml')
if __name__ == "__main__": sim_file = "simulations/sim_NUC.txt" parser = argparse.ArgumentParser(description='This is a Combinational tool\ for validation systems') parser.add_argument('--simulation_file', dest="sim_file", type=file) args = parser.parse_args() if args.sim_file: sim_file = args.sim_file # Read simulation file to get system and rules information if os.path.isfile(sim_file): sim_obj = ReadConfig(sim_file) sim_obj.load_simulation_values() sim_files = sim_obj.get_sim_files() else: print("ERROR: File %s does not exist", sim_file) sys.exit(-1) # main db db_dic = {} #array of size of elements per component comp_len_dic = {} for comp, file_path in sim_files.items(): if os.path.isfile(file_path): # create array of dictionaries to combine