def test_get_image_pages_returns_correctly_with_continue(): with open(os.path.join(RESOURCES, 'response_small_with_continue.json')) as f: resp_dict = json.load(f) expect_result = { '84798633': { 'pageid': 84798633, 'title': 'File:Ambassade1.jpg' } } actual_result = wmc._get_image_pages(resp_dict) assert actual_result == expect_result
def test_get_image_pages_returns_correctly_with_none_json(): expect_result = None actual_result = wmc._get_image_pages(None) assert actual_result == expect_result
def test_get_image_pages_returns_correctly_with_no_pages(): expect_result = None actual_result = wmc._get_image_pages({'batch_complete': ''}) assert actual_result == expect_result