From 340acc562be96a9c1d71c08d76966f6c8f6da52a Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 17 Jul 2015 15:42:54 -0400 Subject: [PATCH] Test: Added obfuscation test --- test/obfuscate.t | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) 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