Test: Merged bug.851.t into math.t

This commit is contained in:
Paul Beckingham 2015-10-23 08:29:51 -04:00
parent 2c4a084cb0
commit 4e178c8186
2 changed files with 23 additions and 66 deletions

View file

@ -84,6 +84,29 @@ class TestMath(TestCase):
code, out, err = self.t('_get 6.due')
self.assertEqual(out, self.when)
class TestBug851(TestCase):
@classmethod
def setUpClass(cls):
"""Executed once before any test in the class"""
cls.t = Task()
cls.t('add past due:-2days')
cls.t('add future due:2days')
def setUp(self):
"""Executed before each test in the class"""
def test_attribute_before_with_math(self):
"""851: Test due.before:now+1d"""
code, out, err = self.t('due.before:now+1day ls')
self.assertIn("past", out)
self.assertNotIn("future", out)
def test_attribute_after_with_math(self):
"""851: Test due.after:now+1d"""
code, out, err = self.t('due.after:now+1day ls')
self.assertNotIn("past", out)
self.assertIn("future", out)
if __name__ == "__main__":
from simpletap import TAPTestRunner