mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Test: Added obfuscation test
This commit is contained in:
parent
251eedf7e5
commit
340acc562b
1 changed files with 18 additions and 6 deletions
|
@ -36,15 +36,18 @@ from basetest import Task, TestCase
|
||||||
|
|
||||||
|
|
||||||
class TestObfuscation(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):
|
def setUp(self):
|
||||||
"""Executed before each test in the class"""
|
"""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")
|
code, out, err = self.t("1 info")
|
||||||
self.assertIn("SECRET", out)
|
self.assertIn("SECRET", out)
|
||||||
|
|
||||||
|
@ -52,6 +55,15 @@ class TestObfuscation(TestCase):
|
||||||
self.assertIn("xxxxxx", out)
|
self.assertIn("xxxxxx", out)
|
||||||
self.assertNotIn("SECRET", 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__":
|
if __name__ == "__main__":
|
||||||
from simpletap import TAPTestRunner
|
from simpletap import TAPTestRunner
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue