Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Jul 6, 2022
1 parent 751f215 commit 1fa65ba
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions python/test/test_unittestresults.py
Expand Up @@ -80,6 +80,12 @@ def test_parse_error_from_error(self):
expected = ParseError('file', 'error', exception=error)
self.assertEqual(expected, actual)

def test_parse_error_with_exception(self):
error = ValueError('error')
actual = ParseError.from_exception('file', error)
expected = ParseError('file', 'error', exception=None)
self.assertEqual(expected, actual.without_exception())

def test_parsed_unit_test_results_with_commit(self):
self.assertEqual(
ParsedUnitTestResultsWithCommit(
Expand Down Expand Up @@ -113,6 +119,16 @@ def test_parsed_unit_test_results_with_commit(self):
).with_commit('commit sha')
)

def test_unit_test_run_results_without_exception(self):
results = create_unit_test_run_results(errors=errors)
self.assertEqual(create_unit_test_run_results(errors=[error.without_exception() for error in errors]),
results.without_exceptions())

def test_unit_test_run_delta_results_without_exception(self):
results = create_unit_test_run_delta_results(errors=errors)
self.assertEqual(create_unit_test_run_delta_results(errors=[error.without_exception() for error in errors]),
results.without_exceptions())

def test_unit_test_run_results_to_dict(self):
actual = UnitTestRunResults(
files=1, errors=errors, suites=2, duration=3,
Expand Down

0 comments on commit 1fa65ba

Please sign in to comment.