nixpkgs/pkgs/applications/misc/pytrainer/fix-test-tz.patch
2018-02-27 22:21:38 +01:00

43 lines
2.6 KiB
Diff

diff -Nurp source.orig/pytrainer/test/core/test_activity.py source/pytrainer/test/core/test_activity.py
--- source.orig/pytrainer/test/core/test_activity.py 2018-02-27 22:15:32.078243354 +0100
+++ source/pytrainer/test/core/test_activity.py 2018-02-27 22:16:33.936867052 +0100
@@ -92,7 +92,7 @@ class ActivityTest(unittest.TestCase):
self.assertEquals(self.activity.time, self.activity.duration)
def test_activity_starttime(self):
- self.assertEquals(self.activity.starttime, '12:58:23 PM')
+ self.assertEquals(self.activity.starttime, '12:58:23')
def test_activity_time_tuple(self):
self.assertEquals(self.activity.time_tuple, (2, 3, 46))
diff -Nurp source.orig/pytrainer/test/imports/test_garmintcxv2.py source/pytrainer/test/imports/test_garmintcxv2.py
--- source.orig/pytrainer/test/imports/test_garmintcxv2.py 2018-02-27 22:15:32.079243364 +0100
+++ source/pytrainer/test/imports/test_garmintcxv2.py 2018-02-27 22:17:10.778333751 +0100
@@ -39,7 +39,7 @@ class GarminTCXv2Test(unittest.TestCase)
self.fail()
def test_workout_summary(self):
- summary = [(0, False, '2012-10-14T12:02:42', '10.12', '00:39:51', 'Running')]
+ summary = [(0, False, '2012-10-14T10:02:42', '10.12', '00:39:51', 'Running')]
try:
current_path = os.path.dirname(os.path.abspath(__file__))
data_path = os.path.dirname(os.path.dirname(os.path.dirname(current_path))) + "/"
@@ -52,7 +52,7 @@ class GarminTCXv2Test(unittest.TestCase)
self.fail()
def test_summary_in_database(self):
- summary = [(0, True, '2012-10-14T12:02:42', '10.12', '00:39:51', 'Running')]
+ summary = [(0, True, '2012-10-14T10:02:42', '10.12', '00:39:51', 'Running')]
activity = Activity(date_time_utc='2012-10-14T10:02:42Z', sport_id='1')
self.ddbb.session.add(activity)
self.ddbb.session.commit()
diff -Nurp source.orig/pytrainer/test/lib/test_date.py source/pytrainer/test/lib/test_date.py
--- source.orig/pytrainer/test/lib/test_date.py 2018-02-27 22:15:32.079243364 +0100
+++ source/pytrainer/test/lib/test_date.py 2018-02-27 22:16:33.936867052 +0100
@@ -45,4 +45,4 @@ class DateFunctionTest(unittest.TestCase
def test_getDateTime(self):
utctime, localtime = getDateTime('Tue Nov 24 17:29:05 UTC 2015')
self.assertEqual(datetime.datetime(2015, 11, 24, 17, 29, 5, tzinfo=tzutc()), utctime)
- self.assertEqual(datetime.datetime(2015, 11, 24, 19, 29, 5, tzinfo=tzlocal()), localtime)
+ self.assertEqual(datetime.datetime(2015, 11, 24, 17, 29, 5, tzinfo=tzlocal()), localtime)