Skip to content
Permalink
Browse files

Add missing 'Z' to datetime string when using UTC

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
  • Loading branch information...
lauft committed Apr 11, 2019
1 parent f0f49eb commit b5dc745969f28d82a194311f0315fb7907c06f5a
Showing with 5 additions and 5 deletions.
  1. +5 −5 test/start.t
@@ -209,8 +209,8 @@ class TestStart(TestCase):
two_hours_before_utc = now_utc - timedelta(hours=2)
one_hour_before_utc = now_utc - timedelta(hours=1)

self.t("track {:%Y-%m-%dT%H:%M:%S} - {:%Y-%m-%dT%H:%M:%S} foo".format(two_hours_before_utc, one_hour_before_utc))
code, out, err = self.t("start {:%Y-%m-%dT%H:%M:%S} bar".format(now_utc))
self.t("track {:%Y-%m-%dT%H:%M:%S}Z - {:%Y-%m-%dT%H:%M:%S}Z foo".format(two_hours_before_utc, one_hour_before_utc))
code, out, err = self.t("start {:%Y-%m-%dT%H:%M:%S}Z bar".format(now_utc))

self.assertIn("Note: 'bar' is a new tag", out)
self.assertIn("Tracking bar", out)
@@ -223,9 +223,9 @@ class TestStart(TestCase):
two_hours_before_utc = now_utc - timedelta(hours=2)
one_hour_before_utc = now_utc - timedelta(hours=1)

self.t("track {:%Y-%m-%dT%H:%M:%S} - {:%Y-%m-%dT%H:%M:%S} bar".format(three_hours_before_utc, two_hours_before_utc))
self.t("track {:%Y-%m-%dT%H:%M:%S} - {:%Y-%m-%dT%H:%M:%S} foo".format(two_hours_before_utc, one_hour_before_utc))
code, out, err = self.t("start {:%Y-%m-%dT%H:%M:%S} bar".format(now_utc))
self.t("track {:%Y-%m-%dT%H:%M:%S}Z - {:%Y-%m-%dT%H:%M:%S}Z bar".format(three_hours_before_utc, two_hours_before_utc))
self.t("track {:%Y-%m-%dT%H:%M:%S}Z - {:%Y-%m-%dT%H:%M:%S}Z foo".format(two_hours_before_utc, one_hour_before_utc))
code, out, err = self.t("start {:%Y-%m-%dT%H:%M:%S}Z bar".format(now_utc))

self.assertNotIn("Note: 'bar' is a new tag", out)
self.assertIn("Tracking bar", out)

0 comments on commit b5dc745

Please sign in to comment.
You can’t perform that action at this time.