Skip to content
Snippets Groups Projects
Commit 0f8452d7 authored by Stefano Zacchiroli's avatar Stefano Zacchiroli
Browse files

tests: also test type-specific getters

parent 064e9445
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,8 @@ def test_get_content(web_api_client, web_api_mock):
assert obj["checksums"]["sha1"] == \
"dc2830a9e72f23c1dfebef4413003221baa5fb62"
assert obj == web_api_client.content(pid)
def test_get_directory(web_api_client, web_api_mock):
pid = parse_pid("swh:1:dir:977fc4b98c0e85816348cebd3b12026407c368b6")
......@@ -33,6 +35,8 @@ def test_get_directory(web_api_client, web_api_mock):
assert dir_entry["name"] == ".bzrignore"
assert dir_entry["length"] == 582
assert obj == web_api_client.directory(pid)
def test_get_release(web_api_client, web_api_mock):
pid = parse_pid("swh:1:rel:b9db10d00835e9a43e2eebef2db1d04d4ae82342")
......@@ -48,6 +52,8 @@ def test_get_release(web_api_client, web_api_mock):
"swh:1:rev:e005cb773c769436709ca6a1d625dc784dbc1636")
assert not obj["synthetic"]
assert obj == web_api_client.release(pid)
def test_get_revision(web_api_client, web_api_mock):
pid = parse_pid("swh:1:rev:aafb16d69fd30ff58afdd69036a26047f3aebdc6")
......@@ -69,6 +75,8 @@ def test_get_revision(web_api_client, web_api_mock):
assert obj["parents"][1]["id"] == parse_pid(
"swh:1:rev:37fc9e08d0c4b71807a4f1ecb06112e78d91c283")
assert obj == web_api_client.revision(pid)
def test_get_snapshot(web_api_client, web_api_mock):
# small snapshot, the one from Web API doc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment