Skip to content

Commit

Permalink
Appease the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
amplifi committed Mar 6, 2017
1 parent 7745e75 commit 7077b8c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
3 changes: 2 additions & 1 deletion cadasta/config/settings/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@
}
}

ICON_URL = ('https://s3-us-west-2.amazonaws.com/cadasta-resources/icons/{}.png')
ICON_URL = ('https://s3-us-west-2.amazonaws.com/cadasta-resources'
'/icons/{}.png')

ICON_LOOKUPS = {
'application/pdf': 'pdf',
Expand Down
36 changes: 24 additions & 12 deletions cadasta/resources/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,52 +64,59 @@ def test_thumbnail_pdf(self):
mime_type='application/pdf'
)
assert (resource.thumbnail ==
'https://s3-us-west-2.amazonaws.com/cadasta-resources/icons/pdf.png')
'https://s3-us-west-2.amazonaws.com/cadasta-resources'
'/icons/pdf.png')

def test_thumbnail_mp3(self):
resource = ResourceFactory.build(
file='http://example.com/dir/filename.mp3',
mime_type='audio/mpeg3'
)
assert (resource.thumbnail ==
'https://s3-us-west-2.amazonaws.com/cadasta-resources/icons/mp3.png')
'https://s3-us-west-2.amazonaws.com/cadasta-resources'
'/icons/mp3.png')

resource = ResourceFactory.build(
file='http://example.com/dir/filename.mp3',
mime_type='audio/x-mpeg-3'
)
assert (resource.thumbnail ==
'https://s3-us-west-2.amazonaws.com/cadasta-resources/icons/mp3.png')
'https://s3-us-west-2.amazonaws.com/cadasta-resources'
'/icons/mp3.png')

resource = ResourceFactory.build(
file='http://example.com/dir/filename.mp3',
mime_type='video/mpeg'
)
assert (resource.thumbnail ==
'https://s3-us-west-2.amazonaws.com/cadasta-resources/icons/mp3.png')
'https://s3-us-west-2.amazonaws.com/cadasta-resources'
'/icons/mp3.png')

resource = ResourceFactory.build(
file='http://example.com/dir/filename.mp3',
mime_type='video/x-mpeg'
)
assert (resource.thumbnail ==
'https://s3-us-west-2.amazonaws.com/cadasta-resources/icons/mp3.png')
'https://s3-us-west-2.amazonaws.com/cadasta-resources'
'/icons/mp3.png')

def test_thumbnail_mp4(self):
resource = ResourceFactory.build(
file='http://example.com/dir/filename.mp4',
mime_type='video/mp4'
)
assert (resource.thumbnail ==
'https://s3-us-west-2.amazonaws.com/cadasta-resources/icons/mp4.png')
'https://s3-us-west-2.amazonaws.com/cadasta-resources'
'/icons/mp4.png')

def test_thumbnail_doc(self):
resource = ResourceFactory.build(
file='http://example.com/dir/filename.doc',
mime_type='application/msword'
)
assert (resource.thumbnail ==
'https://s3-us-west-2.amazonaws.com/cadasta-resources/icons/doc.png')
'https://s3-us-west-2.amazonaws.com/cadasta-resources'
'/icons/doc.png')

def test_thumbnail_docx(self):
resource = ResourceFactory.build(
Expand All @@ -118,22 +125,25 @@ def test_thumbnail_docx(self):
'wordprocessingml.document')
)
assert (resource.thumbnail ==
'https://s3-us-west-2.amazonaws.com/cadasta-resources/icons/docx.png')
'https://s3-us-west-2.amazonaws.com/cadasta-resources'
'/icons/docx.png')

def test_thumbnail_xls(self):
resource = ResourceFactory.build(
file='http://example.com/dir/filename.doc',
mime_type='application/msexcel'
)
assert (resource.thumbnail ==
'https://s3-us-west-2.amazonaws.com/cadasta-resources/icons/xls.png')
'https://s3-us-west-2.amazonaws.com/cadasta-resources'
'/icons/xls.png')

resource = ResourceFactory.build(
file='http://example.com/dir/filename.doc',
mime_type='application/vnd.ms-excel'
)
assert (resource.thumbnail ==
'https://s3-us-west-2.amazonaws.com/cadasta-resources/icons/xls.png')
'https://s3-us-west-2.amazonaws.com/cadasta-resources'
'/icons/xls.png')

def test_thumbnail_xlsx(self):
resource = ResourceFactory.build(
Expand All @@ -142,14 +152,16 @@ def test_thumbnail_xlsx(self):
'.spreadsheetml.sheet')
)
assert (resource.thumbnail ==
'https://s3-us-west-2.amazonaws.com/cadasta-resources/icons/xlsx.png')
'https://s3-us-west-2.amazonaws.com/cadasta-resources'
'/icons/xlsx.png')

def test_thumbnail_xml(self):
resource = ResourceFactory.build(
file='http://example.com/dir/filename.gpx',
mime_type=('text/xml'))
assert (resource.thumbnail ==
'https://s3-us-west-2.amazonaws.com/cadasta-resources/icons/xml.png')
'https://s3-us-west-2.amazonaws.com/cadasta-resources'
'/icons/xml.png')

def test_thumbnail_other(self):
resource = ResourceFactory.build(
Expand Down

0 comments on commit 7077b8c

Please sign in to comment.