Skip to content
Snippets Groups Projects
Commit 3827ee3e authored by Hamer Iboshi's avatar Hamer Iboshi
Browse files

Added command help messages and added verbose option that show the difference...

Added command help messages and added verbose option that show the difference between saved file and actual state file
parent 3589f385
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,7 @@ class RegressionTest: ...@@ -49,7 +49,7 @@ class RegressionTest:
except Exception as ex: except Exception as ex:
cprint(str(ex)+" Not saved, a problem ocurred at "+name+" "+url,'red') cprint(str(ex)+" Not saved, a problem ocurred at "+name+" "+url,'red')
def compare(self): def compare(self, verbose):
fail = 0 fail = 0
for route in self.route_list: for route in self.route_list:
name = route[0] name = route[0]
...@@ -61,13 +61,13 @@ class RegressionTest: ...@@ -61,13 +61,13 @@ class RegressionTest:
try: try:
api_csv = pd.read_csv(url,float_precision='round_trip', encoding="utf-8-sig") #get from api api_csv = pd.read_csv(url,float_precision='round_trip', encoding="utf-8-sig") #get from api
csv_route = pd.read_csv('route_result/'+file_name+'.csv', index_col=0, float_precision='round_trip', encoding="utf-8-sig") #get file csv_route = pd.read_csv('route_result/'+file_name+'.csv', index_col=0, float_precision='round_trip', encoding="utf-8-sig") #get file
if(csv_route.equals(api_csv)): #comparing csv if csv_route.equals(api_csv): #comparing csv
cprint(name+' OK!','green') cprint(name+' OK!','green')
else: else:
fail+=1 fail+=1
cprint(name+' FAIL!','red') cprint(name+' FAIL!','red')
# print(api_csv) if verbose:
# print(csv_route) print(pd.concat([csv_route, api_csv]).drop_duplicates(keep=False))
except Exception as ex: except Exception as ex:
cprint(str(ex)+"\n"+name+' FAIL!','red') cprint(str(ex)+"\n"+name+' FAIL!','red')
fail+=1 fail+=1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment