From fdbb8e02f0f7459082805ca57f8dbe6d75e0118a Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Fri, 18 Jul 2014 14:01:14 +0100 Subject: [PATCH] Unittest - Add test example using libfaketime --- test/template.t | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/template.t b/test/template.t index e3db8b8a8..4122cb2b4 100755 --- a/test/template.t +++ b/test/template.t @@ -37,6 +37,23 @@ class TestBugNumber(TestCase): # TAP diagnostics on the bas self.diag("Yay TAP diagnostics") + def test_faketime(self): + """Running tests using libfaketime""" + self.t.faketime("-2y") + + command = ("add", "Testing") + self.t(command) + + # Remove FAKETIME settings + self.t.faketime() + + command = ("list",) + code, out, err = self.t(command) + + # Task should be 2 years old + expected = "2.0y" + self.assertIn(expected, out) + def test_fail_other(self): """Nothing to do with Copyright""" self.assertEqual("I like to code", "I like\nto code\n")