Skip to content

Commit

Permalink
add test_dict_report_with_all_passed_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed Nov 7, 2019
1 parent 8c249d8 commit 93fae03
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions vunit/test/unit/test_test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from os.path import join, dirname
import os
from vunit.test_report import TestReport, PASSED, SKIPPED, FAILED
from vunit.ui.results import Results


class TestTestReport(TestCase):
Expand Down Expand Up @@ -274,6 +275,29 @@ def test_junit_report_with_testcase_classname(self):
),
)

def test_dict_report_with_all_passed_tests(self):
test_path = dirname(self.output_file_name)
results = Results(
dirname(test_path), None, self._report_with_all_passed_tests(),
)
report = results.get_report()
for _, val in report.tests.items():
self.assertEqual(
join(report.output_path, val["path"], ""),
report.get_full_path(val["path"]),
)
self.assertEqual(
join(report.output_path, val["path"], "output.txt"),
report.get_full_path(val["path"], "output.txt"),
)
self.assertEqual(
report.tests,
{
"passed_test0": {"status": "passed", "time": 1.0, "path": test_path},
"passed_test1": {"status": "passed", "time": 2.0, "path": test_path},
},
)

def _report_with_all_passed_tests(self):
" @returns A report with all passed tests "
report = self._new_report()
Expand Down

0 comments on commit 93fae03

Please sign in to comment.