def test_get_image_url_returns_medium_tuple_when_large_not_avail(): data = _get_resource_json('image_data_with_med_url_available.json') actual_tuple = flickr._get_image_url(data) expect_tuple = ('https://live.staticflickr.com/456.jpg', 375, 500) assert expect_tuple == actual_tuple
def test_get_image_url_returns_Nonetype_tuple_if_no_image(): data = _get_resource_json('image_data_no_image_url.json') actual_tuple = flickr._get_image_url(data) expect_tuple = (None, None, None) assert expect_tuple == actual_tuple
def test_get_image_url_returns_large_tuple_when_avail(): image_data = _get_resource_json('image_data_with_large_url_available.json') actual_tuple = flickr._get_image_url(image_data) expect_tuple = ('https://live.staticflickr.com/456_b.jpg', 768, 1024) assert expect_tuple == actual_tuple
def test_get_image_url_falls_to_small_tuple(): data = _get_resource_json('image_data_with_small_url_available.json') actual_tuple = flickr._get_image_url(data) expect_tuple = ('https://live.staticflickr.com/456_m.jpg', 180, 240) assert expect_tuple == actual_tuple