Skip to content

Commit

Permalink
Another try at fixing the gmail utc tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Aug 3, 2019
1 parent ac94211 commit 0c565a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bugwarrior/services/gmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def get_annotations(self):
return self.extra.get('annotations', [])

def get_entry(self):
date_string = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(self.extra['internal_date']) / 1000))
return self.parse_date(date_string, 'LOCAL_TIMEZONE')
date_string = time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(int(self.extra['internal_date']) / 1000))
return self.parse_date(date_string)


class GmailService(IssueService):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_gmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import datetime

import mock
from dateutil.tz import tzlocal
from dateutil.tz import tzutc

import bugwarrior.services.gmail as gmail
from .base import ServiceTest, AbstractServiceTest
Expand Down Expand Up @@ -86,7 +86,7 @@ def test_to_taskwarrior(self):
gmail.thread_extras(thread, self.service.get_labels()))
expected = {
'annotations': [],
'entry': datetime(2019, 1, 5, 21, 7, 47, tzinfo=tzlocal()),
'entry': datetime(2019, 1, 5, 21, 7, 47, tzinfo=tzutc()),
'gmailthreadid': '1234',
'gmaillastmessageid': 'CMCRSF+6r=x5JtW4wlRYR5qdfRq+iAtSoec5NqrHvRpvVgHbHdg@mail.gmail.com',
'gmailsnippet': 'Bugwarrior is great',
Expand All @@ -107,7 +107,7 @@ def test_issues(self):
issue = next(self.service.issues())
expected = {
'annotations': ['@Foo Bar - Regarding Bugwarrior'],
'entry': datetime(2019, 1, 5, 21, 7, 47, tzinfo=tzlocal()),
'entry': datetime(2019, 1, 5, 21, 7, 47, tzinfo=tzutc()),
'gmailthreadid': '1234',
'gmaillastmessageid': 'CMCRSF+6r=x5JtW4wlRYR5qdfRq+iAtSoec5NqrHvRpvVgHbHdg@mail.gmail.com',
'gmailsnippet': 'Bugwarrior is great',
Expand Down

0 comments on commit 0c565a4

Please sign in to comment.