Esempio n. 1
0
def test_get_license_url_handles_missing_license_url():
    with open(os.path.join(RESOURCES,
                           'image_info_artist_partial_link.json')) as f:
        image_info = json.load(f)
    expect_license_url = ''
    actual_license_url = wmc._get_license_url(image_info)
    assert actual_license_url == expect_license_url
Esempio n. 2
0
def test_get_license_url_finds_license_url():
    with open(os.path.join(RESOURCES,
                           'image_info_from_example_data.json')) as f:
        image_info = json.load(f)

    expect_license_url = 'https://creativecommons.org/licenses/by-sa/4.0'
    actual_license_url = wmc._get_license_url(image_info)
    assert actual_license_url == expect_license_url