From 78b23090feed847db44d7c921ff49c02cc948878 Mon Sep 17 00:00:00 2001 From: franek Date: Mon, 15 Jun 2015 11:10:50 +0200 Subject: [PATCH] add test on get_size method when missing image --- tests/test_image.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_image.py b/tests/test_image.py index 1edd9aa..638ac26 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -124,4 +124,13 @@ def test_get_size(tmpdir): test_image) result = get_size(src_file) - assert result == {'height': 800, 'width': 600} \ No newline at end of file + 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 \ No newline at end of file