def test_bad_url2dict(url, raises): with pytest.raises(raises): storefact.url2dict(url)
def test_raise_on_invalid_store(): with pytest.raises(ValueError): storefact.url2dict(u'dummy://foo/bar')
def test_url2dict(url, expected): assert storefact.url2dict(url) == expected
def test_json_decode(): url, _ = ACTUAL_URL creds = storefact.url2dict(url)["credentials"] with open("tests/gcstore_cred_example.json") as file: assert json.loads(creds) == json.load(file)