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.report()
else:
report = Report(args.file, args.compare)
report.report()
if args.excel:
excel = Excel(
file_name=args.file,
compare=args.compare,
)
excel.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()
try:
report = Report(args.file, args.compare)
except FileNotFoundError as e:
print(e)
else:
report.report()
if args.excel:
excel = Excel(
file_name=args.file,
compare=args.compare,
)
excel.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.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):
file_name = "results_accuracy_STree_iMac27_2021-09-30_11:42:07_0.json"
stdout, stderr = self.execute_script(