diff --git a/test/obfuscate.t b/test/obfuscate.t index 59af284c6..d929817df 100755 --- a/test/obfuscate.t +++ b/test/obfuscate.t @@ -36,15 +36,18 @@ from basetest import Task, TestCase class TestObfuscation(TestCase): + @classmethod + def setUpClass(cls): + """Executed once before any test in the class""" + cls.t = Task() + cls.t("add SECRET project:SECRET +SECRET") + cls.t("1 annotate SECRET") + def setUp(self): """Executed before each test in the class""" - self.t = Task() - - def test_obfuscation(self): - """Verify that obfuscation hides all text""" - self.t("add SECRET project:SECRET +SECRET") - self.t("1 annotate SECRET") + def test_info_obfuscation(self): + """Verify that obfuscation hides all text in the 'info' command""" code, out, err = self.t("1 info") self.assertIn("SECRET", out) @@ -52,6 +55,15 @@ class TestObfuscation(TestCase): self.assertIn("xxxxxx", out) self.assertNotIn("SECRET", out) + def test_list_obfuscation(self): + """Verify that obfuscation hides all text in a report""" + code, out, err = self.t("list") + self.assertIn("SECRET", out) + + code, out, err = self.t("rc.obfuscate:1 list") + self.assertIn("xxxxxx", out) + self.assertNotIn("SECRET", out) + if __name__ == "__main__": from simpletap import TAPTestRunner