From a5563ba1355bb1e9594aa9c3268a71bd707ba436 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 13 Oct 2014 00:39:17 -0400 Subject: [PATCH] TW-1424 - TW-1424 Using a date of '1824days' (in the future) fails (thanks to Black Ops Testing). --- ChangeLog | 2 ++ test/tw-1424.t | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 test/tw-1424.t diff --git a/ChangeLog b/ChangeLog index d9aea62e2..c7ce821a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -164,6 +164,8 @@ Black Ops Testing). - TW-1422 Attempt to modify 'id' attribute creates an id attribute (thanks to Black Ops Testing). +- TW-1424 Using a date of '1824days' (in the future) fails (thanks to Black Ops + Testing). - TW-1428 Add support for color.uda.. rules. - Removed deprecated 'echo.command' setting, in favor of the 'header' and 'affected' verbosity tokens. diff --git a/test/tw-1424.t b/test/tw-1424.t new file mode 100755 index 000000000..2cbcedf4d --- /dev/null +++ b/test/tw-1424.t @@ -0,0 +1,35 @@ +#!/usr/bin/env python2.7 +# -*- coding: utf-8 -*- + +import sys +import os +from datetime import datetime +import unittest + +# Ensure python finds the local simpletap module +sys.path.append(os.path.dirname(os.path.abspath(__file__))) + +from basetest import Task, TestCase, Taskd, ServerTestCase + + +class Test1424(TestCase): + def setUp(self): + self.t = Task() + + def test_1824_days(self): + """Check that due:1824d works""" + self.t(('add', 'foo', 'due:1824d')) + code, out, err = self.t(('_get', '1.due.year')) + self.assertEqual(out, "%d\n" % (datetime.now().year + 5)) + + def test_3648_days(self): + """Check that due:3648d works""" + self.t(('add', 'foo', 'due:3648d')) + code, out, err = self.t(('_get', '1.due.year')) + self.assertEqual(out, "%d\n" % (datetime.now().year + 10)) + +if __name__ == "__main__": + from simpletap import TAPTestRunner + unittest.main(testRunner=TAPTestRunner()) + +# vim: ai sts=4 et sw=4