def test_image_info_large(): large_image = _get_resource_json("large_image.json") actual_image, actual_height, actual_width = sm._get_image_info(large_image) expected_image = "https://coimages.sciencemuseumgroup.org.uk/images/3/563/large_1999_0299_0001__0002_.jpg" expected_height = 1022 expected_width = 1536 assert actual_image == expected_image assert actual_height == expected_height assert actual_width == expected_width
def test_image_info_medium(): medium_image = _get_resource_json("medium_image.json") actual_image, actual_height, actual_width = sm._get_image_info( medium_image) expected_image = "https://coimages.sciencemuseumgroup.org.uk/images/3/563/medium_1999_0299_0001__0002_.jpg" expected_height = 576 expected_width = 866 assert actual_image == expected_image assert actual_height == expected_height assert actual_width == expected_width
def test_image_info_failure(): actual_image, actual_height, actual_width = sm._get_image_info({}) assert actual_image is None assert actual_height is None assert actual_width is None