INNER CODE UNIT · Python
TestRender
apache/ozone · dev-support/ci/test_junit_summary.py:108
class TestRender(unittest.TestCase):
def make_cases(self):
tc = junit_summary.TestCase
return [
tc("common", "org.X", "ok", 1.0, "passed"),
tc("common", "org.X", "bad", 2.0, "failed", "boom"),
tc("common", "org.X", "shaky", 3.0, "flaky", "flap"),
tc("common", "org.X", "skip", 0.0, "skipped"),
]
def test_format_time(self):
self.assertEqual(junit_summary.format_time(59), "59s")
self.assertEqual(junit_summary.format_time(779), "12m59s")
self.assertEqual(junit_summary.format_time(3725), "1h2m5s")
def test_render_counts_list(self):
md = junit_summary.render_summary(self.make_cases())