Add file not found manage to be_report

This commit is contained in:
2022-05-09 12:02:33 +02:00
parent 7501ce7761
commit e45ef1c9fa
2 changed files with 22 additions and 13 deletions

View File

@@ -27,16 +27,20 @@ def main(args_test=None):
report = ReportBest(args.score, args.model, args.best, args.grid) report = ReportBest(args.score, args.model, args.best, args.grid)
report.report() report.report()
else: else:
report = Report(args.file, args.compare) try:
report.report() report = Report(args.file, args.compare)
if args.excel: except FileNotFoundError as e:
excel = Excel( print(e)
file_name=args.file, else:
compare=args.compare, report.report()
) if args.excel:
excel.report() excel = Excel(
is_test = args_test is not None file_name=args.file,
Files.open(excel.get_file_name(), is_test) compare=args.compare,
if args.sql: )
sql = SQL(args.file) excel.report()
sql.report() is_test = args_test is not None
Files.open(excel.get_file_name(), is_test)
if args.sql:
sql = SQL(args.file)
sql.report()

View File

@@ -25,6 +25,11 @@ class BeReportTest(TestBase):
self.assertEqual(stderr.getvalue(), "") self.assertEqual(stderr.getvalue(), "")
self.check_output_file(stdout, "report") self.check_output_file(stdout, "report")
def test_be_report_not_found(self):
stdout, stderr = self.execute_script("be_report", ["-f", "unknown"])
self.assertEqual(stderr.getvalue(), "")
self.assertEqual(stdout.getvalue(), "unknown does not exists!\n")
def test_be_report_compare(self): def test_be_report_compare(self):
file_name = "results_accuracy_STree_iMac27_2021-09-30_11:42:07_0.json" file_name = "results_accuracy_STree_iMac27_2021-09-30_11:42:07_0.json"
stdout, stderr = self.execute_script( stdout, stderr = self.execute_script(