add test on get_size method when missing image

This commit is contained in:
franek
2015-06-15 11:10:50 +02:00
parent a7e9c17489
commit 78b23090fe

View File

@@ -124,4 +124,13 @@ def test_get_size(tmpdir):
test_image)
result = get_size(src_file)
assert result == {'height': 800, 'width': 600}
assert result == {'height': 800, 'width': 600}
def test_get_size_with_invalid_path(tmpdir):
"""Test reading out image size with a missing file"""
test_image = 'missing-file.jpg'
src_file = os.path.join(CURRENT_DIR, test_image)
result = get_size(src_file)
assert result == None