Tests: Rename self.diag to self.tap and use self.t.diag where applicable
Having self.diag and self.t.diag was confusing as one referred to TAP output (self.diag) while the other referred to "task diagnostics" self.t.diag. self.diag is now gone and was replaced by self.tap with the same behavior.
This commit is contained in:
@@ -7,11 +7,11 @@ from .taskd import Taskd
|
|||||||
|
|
||||||
|
|
||||||
class BaseTestCase(unittest.TestCase):
|
class BaseTestCase(unittest.TestCase):
|
||||||
def diag(self, out):
|
def tap(self, out):
|
||||||
sys.stderr.write("--- diag start ---\n")
|
sys.stderr.write("--- tap output start ---\n")
|
||||||
for line in out.splitlines():
|
for line in out.splitlines():
|
||||||
sys.stderr.write(line + '\n')
|
sys.stderr.write(line + '\n')
|
||||||
sys.stderr.write("--- diag end ---\n")
|
sys.stderr.write("--- tap output end ---\n")
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipIf(TASKW_SKIP, "TASKW_SKIP set, skipping task tests.")
|
@unittest.skipIf(TASKW_SKIP, "TASKW_SKIP set, skipping task tests.")
|
||||||
|
|||||||
@@ -119,8 +119,7 @@ class TestBug360AllowedChanges(BaseTestBug360):
|
|||||||
self.assertNotIn(expected, err)
|
self.assertNotIn(expected, err)
|
||||||
|
|
||||||
# Make sure no duplicate tasks were created
|
# Make sure no duplicate tasks were created
|
||||||
args = ("diag",)
|
code, out, err = self.t.diag()
|
||||||
code, out, err = self.t(args)
|
|
||||||
expected = "No duplicates found"
|
expected = "No duplicates found"
|
||||||
self.assertIn(expected, out)
|
self.assertIn(expected, out)
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class TestDiagColor(TestCase):
|
|||||||
def test_diag_color_builtin(self):
|
def test_diag_color_builtin(self):
|
||||||
"""Task diag output, so we can monitor platforms"""
|
"""Task diag output, so we can monitor platforms"""
|
||||||
code, out, err = self.t.diag()
|
code, out, err = self.t.diag()
|
||||||
self.diag (out)
|
self.tap(out)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class TestBugNumber(TestCase):
|
|||||||
self.assertRegexpMatches(out, expected)
|
self.assertRegexpMatches(out, expected)
|
||||||
|
|
||||||
# TAP diagnostics on the bas
|
# TAP diagnostics on the bas
|
||||||
self.diag("Yay TAP diagnostics")
|
self.tap("Yay TAP diagnostics")
|
||||||
|
|
||||||
def test_faketime(self):
|
def test_faketime(self):
|
||||||
"""Running tests using libfaketime"""
|
"""Running tests using libfaketime"""
|
||||||
|
|||||||
@@ -106,9 +106,7 @@ class TestVersion(TestCase):
|
|||||||
"""Task binary matches the current git commit"""
|
"""Task binary matches the current git commit"""
|
||||||
expected = "Commit: {0}".format(self.slurp_git())
|
expected = "Commit: {0}".format(self.slurp_git())
|
||||||
|
|
||||||
args = ("diag",)
|
code, out, err = self.t.diag()
|
||||||
|
|
||||||
code, out, err = self.t(args)
|
|
||||||
self.assertIn(expected, out)
|
self.assertIn(expected, out)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user