Adding tests

This commit is contained in:
Michael Lazar committed 2017-07-25 01:11:12 -04:00
1 parent 24aa430f9f
commit b47f0080c6
2 files changed
+1647 -511

No files matched your search

File diff suppressed because it is too large. Load diff
+10 -1
View File
@@ -103,8 +103,17 @@ def test_imgur_fallback(reddit):
to manually scraping the page.
"""
ImgurApiMIMEParser.CLIENT_ID = ''
for key in ['imgur_1', 'imgur_2', 'imgur_album']:
url, modified_url, mime_type = URLS[key]
assert ImgurApiMIMEParser.pattern.match(url)
parsed_url, parsed_type = ImgurApiMIMEParser.get_mimetype(url)
# Not sure why, but http://imgur.com/gallery/yjP1v4B (a .gif)
# appears to incorrectly return as a JPG type from the scraper
assert parsed_type is not None
ImgurApiMIMEParser.CLIENT_ID = 'invalid_api_key'
for key in ['imgur_1', 'imgur_2', 'imgur_album']:
url, modified_url, mime_type = URLS[key]