mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-18 15:33:08 +02:00
Tests: Fix due.t failure on cygwin
This commit is contained in:
parent
f152d14baa
commit
afa042fdb4
1 changed files with 8 additions and 3 deletions
11
test/due.t
11
test/due.t
|
@ -36,6 +36,11 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
|||
from basetest import Task, TestCase
|
||||
|
||||
|
||||
def timestamp_without_leading_zeros(time):
|
||||
t = time.strftime("%m/%d/%Y")
|
||||
return "/".join([x.lstrip("0") for x in t.split("/")])
|
||||
|
||||
|
||||
class TestDue(TestCase):
|
||||
def setUp(self):
|
||||
self.t = Task()
|
||||
|
@ -49,9 +54,9 @@ class TestDue(TestCase):
|
|||
|
||||
just = datetime.now() + timedelta(days=3)
|
||||
almost = datetime.now() + timedelta(days=5)
|
||||
# NOTE: %-m and %-d are unix only
|
||||
self.just = just.strftime("%-m/%-d/%Y")
|
||||
self.almost = almost.strftime("%-m/%-d/%Y")
|
||||
|
||||
self.just = timestamp_without_leading_zeros(just)
|
||||
self.almost = timestamp_without_leading_zeros(almost)
|
||||
|
||||
self.t(("add", "one", "due:{0}".format(self.just)))
|
||||
self.t(("add", "two", "due:{0}".format(self.almost)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue