Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/taskgraph/util/taskcluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def pagination_handler(response):
def get_artifact_from_index(index_path, artifact_path):
index = get_taskcluster_client("index")
response = index.findArtifactFromTask(index_path, artifact_path)
return _handle_artifact(index_path, response)
return _handle_artifact(artifact_path, response)


def list_tasks(index_path):
Expand Down
15 changes: 15 additions & 0 deletions test/test_util_taskcluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,21 @@ def test_get_artifact_from_index(responses, root_url):
assert result.read() == b"foobar"


def test_get_artifact_from_index_uses_artifact_path_for_parsing(responses, root_url):
# Verify artifact_path (not index_path) is used for determining how to parse the response.
index_path = "foo.bar"
artifact_path = "file.yml"
tc.get_taskcluster_client.cache_clear()

responses.get(
f"{root_url}/api/index/v1/task/{index_path}/artifacts/{artifact_path}",
body=b"key: value",
)

result = tc.get_artifact_from_index(index_path, artifact_path)
assert result == {"key": "value"}


def test_list_tasks(responses, root_url):
index = "foo"
tc.get_taskcluster_client.cache_clear()
Expand Down
Loading