add test on get_size method when missing image
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user