Merge lp:~nskaggs/ubuntu-calendar-app/assert-with-utc into lp:ubuntu-calendar-app

Proposed by Nicholas Skaggs
Status: Merged
Merged at revision: 276
Proposed branch: lp:~nskaggs/ubuntu-calendar-app/assert-with-utc
Merge into: lp:ubuntu-calendar-app
Diff against target: 97 lines (+9/-10)
4 files modified
tests/autopilot/calendar_app/tests/test_dayview.py (+4/-4)
tests/autopilot/calendar_app/tests/test_monthview.py (+1/-1)
tests/autopilot/calendar_app/tests/test_weekview.py (+3/-4)
tests/autopilot/calendar_app/tests/test_yearview.py (+1/-1)
To merge this branch: bzr merge lp:~nskaggs/ubuntu-calendar-app/assert-with-utc
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Ubuntu Calendar Developers Pending
Review via email: mp+220379@code.launchpad.net

Commit message

Fix AP tests to use utc date/time, to match qml properties.

Description of the change

Fix AP tests to use utc date/time, to match qml properties.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/calendar_app/tests/test_dayview.py'
--- tests/autopilot/calendar_app/tests/test_dayview.py 2014-02-24 15:58:49 +0000
+++ tests/autopilot/calendar_app/tests/test_dayview.py 2014-05-21 07:14:31 +0000
@@ -9,7 +9,7 @@
9Calendar app autopilot tests for the day view.9Calendar app autopilot tests for the day view.
10"""10"""
1111
12import datetime12from datetime import datetime
1313
14# from __future__ import range14# from __future__ import range
15# (python3's range, is same as python2's xrange)15# (python3's range, is same as python2's xrange)
@@ -38,7 +38,7 @@
38 def test_current_month_and_year_is_selected(self):38 def test_current_month_and_year_is_selected(self):
39 """By default, the day view shows the current month and year."""39 """By default, the day view shows the current month and year."""
4040
41 now = datetime.datetime.now()41 now = datetime.utcnow()
4242
43 expected_year = now.year43 expected_year = now.year
44 expected_month_name = now.strftime("%B")44 expected_month_name = now.strftime("%B")
@@ -59,7 +59,7 @@
59 days = self.day_view.select_many(objectName="dateLabel")59 days = self.day_view.select_many(objectName="dateLabel")
60 days = [int(day.text) for day in days]60 days = [int(day.text) for day in days]
6161
62 now = datetime.datetime.now()62 now = datetime.utcnow()
6363
64 today = now.day64 today = now.day
65 tomorrow = (now + datetime.timedelta(days=1)).day65 tomorrow = (now + datetime.timedelta(days=1)).day
@@ -78,7 +78,7 @@
78 self.change_days(-1)78 self.change_days(-1)
7979
80 def change_days(self, direction):80 def change_days(self, direction):
81 now = datetime.datetime.now()81 now = datetime.utcnow()
8282
83 for i in range(1, 5):83 for i in range(1, 5):
84 #prevent timing issues with swiping84 #prevent timing issues with swiping
8585
=== modified file 'tests/autopilot/calendar_app/tests/test_monthview.py'
--- tests/autopilot/calendar_app/tests/test_monthview.py 2014-01-09 23:30:55 +0000
+++ tests/autopilot/calendar_app/tests/test_monthview.py 2014-05-21 07:14:31 +0000
@@ -55,7 +55,7 @@
55 Eventually(Equals(after.year)))55 Eventually(Equals(after.year)))
5656
57 def _assert_today(self):57 def _assert_today(self):
58 today = datetime.today()58 today = datetime.utcnow()
59 self.assertThat(lambda: self.month_view.currentMonth.datetime.day,59 self.assertThat(lambda: self.month_view.currentMonth.datetime.day,
60 Eventually(Equals(today.day)))60 Eventually(Equals(today.day)))
61 self.assertThat(lambda: self.month_view.currentMonth.datetime.month,61 self.assertThat(lambda: self.month_view.currentMonth.datetime.month,
6262
=== modified file 'tests/autopilot/calendar_app/tests/test_weekview.py'
--- tests/autopilot/calendar_app/tests/test_weekview.py 2014-03-26 22:03:46 +0000
+++ tests/autopilot/calendar_app/tests/test_weekview.py 2014-05-21 07:14:31 +0000
@@ -15,8 +15,7 @@
15if sys.version_info < (3,):15if sys.version_info < (3,):
16 range = xrange16 range = xrange
1717
18import datetime18from datetime import datetime
19
20from autopilot.matchers import Eventually19from autopilot.matchers import Eventually
21from testtools.matchers import Equals, NotEquals20from testtools.matchers import Equals, NotEquals
2221
@@ -112,7 +111,7 @@
112 def test_current_month_and_year_is_selected(self):111 def test_current_month_and_year_is_selected(self):
113 """By default, the week view shows the current month and year."""112 """By default, the week view shows the current month and year."""
114113
115 now = datetime.datetime.now()114 now = datetime.utcnow()
116115
117 expected_year = now.year116 expected_year = now.year
118 expected_month_name = now.strftime("%B")117 expected_month_name = now.strftime("%B")
@@ -126,7 +125,7 @@
126 def test_current_week_is_selected(self):125 def test_current_week_is_selected(self):
127 """By default, the week view shows the current week."""126 """By default, the week view shows the current week."""
128127
129 now = datetime.datetime.now()128 now = datetime.utcnow()
130 days = self._get_days_of_week()129 days = self._get_days_of_week()
131 day_headers = self._get_date_label_headers()130 day_headers = self._get_date_label_headers()
132131
133132
=== modified file 'tests/autopilot/calendar_app/tests/test_yearview.py'
--- tests/autopilot/calendar_app/tests/test_yearview.py 2014-03-01 02:30:58 +0000
+++ tests/autopilot/calendar_app/tests/test_yearview.py 2014-05-21 07:14:31 +0000
@@ -115,7 +115,7 @@
115 Equals(datetime.now().year))115 Equals(datetime.now().year))
116116
117 def current_month(self):117 def current_month(self):
118 now = datetime.now()118 now = datetime.utcnow()
119 current_month_name = now.strftime("%B")119 current_month_name = now.strftime("%B")
120120
121 # for months after June, we must scroll down the page to have121 # for months after June, we must scroll down the page to have

Subscribers

People subscribed via source and target branches

to status/vote changes: