mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-23 14:36:44 +02:00
Add a test for capitalized months and days of the week.
The change was implemented in https://github.com/GothenburgBitFactory/libshared/pull/33. This change adds validation in TaskWarrior. Fixes: * https://github.com/GothenburgBitFactory/taskwarrior/issues/2160 * https://github.com/GothenburgBitFactory/taskwarrior/issues/2364
This commit is contained in:
parent
a9a7f16af3
commit
e762306563
1 changed files with 37 additions and 0 deletions
|
@ -107,6 +107,43 @@ class TestBug1620(TestCase):
|
||||||
code, out, err = self.t ('long')
|
code, out, err = self.t ('long')
|
||||||
self.assertIn("20150601-1415", out)
|
self.assertIn("20150601-1415", out)
|
||||||
|
|
||||||
|
class TestCapitalizedDays(TestCase):
|
||||||
|
"""Make sure capitalized names such as 'Friday' work.
|
||||||
|
|
||||||
|
Requested in:
|
||||||
|
* https://github.com/GothenburgBitFactory/taskwarrior/issues/2160
|
||||||
|
* https://github.com/GothenburgBitFactory/taskwarrior/issues/2364
|
||||||
|
|
||||||
|
Implemented in libshared:
|
||||||
|
* https://github.com/GothenburgBitFactory/libshared/pull/33
|
||||||
|
"""
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
"""Executed before each test in the class"""
|
||||||
|
self.t = Task()
|
||||||
|
|
||||||
|
def test_dateformat_capitalized(self):
|
||||||
|
"""Verify upper case days and months work"""
|
||||||
|
# Lower case:
|
||||||
|
code, out, err = self.t('add sometask due:mon')
|
||||||
|
code, out, err = self.t('add sometask due:monday')
|
||||||
|
code, out, err = self.t('add sometask due:jan')
|
||||||
|
code, out, err = self.t('add sometask due:january')
|
||||||
|
# Upper case days of the week
|
||||||
|
code, out, err = self.t('add sometask due:Tue')
|
||||||
|
code, out, err = self.t('add sometask due:Tuesday')
|
||||||
|
code, out, err = self.t('add sometask due:Thu')
|
||||||
|
code, out, err = self.t('add sometask due:Thursday')
|
||||||
|
# Upper case months:
|
||||||
|
code, out, err = self.t('add sometask due:Jan')
|
||||||
|
code, out, err = self.t('add sometask due:January')
|
||||||
|
code, out, err = self.t('add sometask due:Jun')
|
||||||
|
code, out, err = self.t('add sometask due:June')
|
||||||
|
code, out, err = self.t('add sometask due:May')
|
||||||
|
|
||||||
|
# Incorrect:
|
||||||
|
code, out, err = self.t.runError('add sometask due:Yo')
|
||||||
|
code, out, err = self.t.runError('add sometask due:TU')
|
||||||
|
|
||||||
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