import unittest from tap.directive import Directive from tap.line import Line, Result class TestLine(unittest.TestCase): """Tests for tap.line.Line""" def test_line_requires_category(self): line = Line() with self.assertRaises(NotImplementedError): line.category class TestResult(unittest.TestCase): """Tests for tap.line.Result""" def test_category(self): result = Result(True) self.assertEqual("test", result.category) def test_ok(self): result = Result(True) self.assertTrue(result.ok) def test_str_ok(self): result = Result(True, 42, "passing") self.assertEqual("ok 42 passing", str(result)) def test_str_not_ok(self): result = Result(False, 43, "failing") self.assertEqual("not ok 43 failing", str(result)) def test_str_directive(self): directive = Directive("SKIP a reason") result = Result(True, 44, "passing", directive) self.assertEqual("ok 44 passing # SKIP a reason", str(result)) def test_str_diagnostics(self): result = Result(False, 43, "failing", diagnostics="# more info") self.assertEqual("not ok 43 failing\n# more info", str(result))
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
__init__.py | File | 71 B | 0644 |
|
factory.py | File | 1.05 KB | 0644 |
|
run.py | File | 456 B | 0644 |
|
test_adapter.py | File | 1.84 KB | 0644 |
|
test_directive.py | File | 1.2 KB | 0644 |
|
test_formatter.py | File | 601 B | 0644 |
|
test_line.py | File | 1.2 KB | 0644 |
|
test_loader.py | File | 3.66 KB | 0644 |
|
test_main.py | File | 1.96 KB | 0644 |
|
test_parser.py | File | 16.24 KB | 0644 |
|
test_result.py | File | 3.4 KB | 0644 |
|
test_rules.py | File | 2.81 KB | 0644 |
|
test_runner.py | File | 3.32 KB | 0644 |
|
test_tracker.py | File | 10.91 KB | 0644 |
|
testcase.py | File | 222 B | 0644 |
|