mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unittest - Add test example using libfaketime
This commit is contained in:
parent
15795e514d
commit
fdbb8e02f0
1 changed files with 17 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue