* Fix tests

* Lint
This commit is contained in:
Paulus Schoutsen 2018-06-14 11:57:09 -04:00 committed by GitHub
parent c36c3f0d64
commit b2440a6d95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 10 deletions

View File

@ -1,7 +1,7 @@
# linters such as flake8 and pylint should be pinned, as new releases
# make new things fail. Manually update these pins when pulling in a
# new version
asynctest>=0.11.1
asynctest==0.12.1
coveralls==1.2.0
flake8-docstrings==1.0.3
flake8==3.5
@ -12,6 +12,6 @@ pylint==1.9.2
pytest-aiohttp==0.3.0
pytest-cov==2.5.1
pytest-sugar==0.9.1
pytest-timeout>=1.2.1
pytest==3.4.2
pytest-timeout==1.3.0
pytest==3.6.1
requests_mock==1.5

View File

@ -2,7 +2,7 @@
# linters such as flake8 and pylint should be pinned, as new releases
# make new things fail. Manually update these pins when pulling in a
# new version
asynctest>=0.11.1
asynctest==0.12.1
coveralls==1.2.0
flake8-docstrings==1.0.3
flake8==3.5
@ -13,8 +13,8 @@ pylint==1.9.2
pytest-aiohttp==0.3.0
pytest-cov==2.5.1
pytest-sugar==0.9.1
pytest-timeout>=1.2.1
pytest==3.4.2
pytest-timeout==1.3.0
pytest==3.6.1
requests_mock==1.5

View File

@ -1,6 +1,6 @@
"""The tests for the feedreader component."""
import time
from datetime import datetime, timedelta
from datetime import timedelta
import unittest
from genericpath import exists
@ -118,9 +118,11 @@ class TestFeedreaderComponent(unittest.TestCase):
assert events[0].data.description == "Description 1"
assert events[0].data.link == "http://www.example.com/link/1"
assert events[0].data.id == "GUID 1"
assert datetime.fromtimestamp(
time.mktime(events[0].data.published_parsed)) == \
datetime(2018, 4, 30, 5, 10, 0)
assert events[0].data.published_parsed.tm_year == 2018
assert events[0].data.published_parsed.tm_mon == 4
assert events[0].data.published_parsed.tm_mday == 30
assert events[0].data.published_parsed.tm_hour == 5
assert events[0].data.published_parsed.tm_min == 10
assert manager.last_update_successful is True
def test_feed_updates(self):