@@ -65,9 +65,9 @@ def test_get_artifact_url(monkeypatch):
6565 tc .get_root_url .cache_clear ()
6666 task_id = "abc"
6767 path = "public/log.txt"
68- expected = "https://tc.example.com/api/queue/v1/task/abc /artifacts/public/log.txt "
68+ expected = f "https://tc.example.com/api/queue/v1/task/{ task_id } /artifacts/{ path } "
6969 expected_proxy = (
70- "https://taskcluster-proxy.net/api/queue/v1/task/abc /artifacts/public/log.txt "
70+ f "https://taskcluster-proxy.net/api/queue/v1/task/{ task_id } /artifacts/{ path } "
7171 )
7272
7373 # Test with default root URL (no proxy)
@@ -86,17 +86,11 @@ def test_get_artifact_url(monkeypatch):
8686 monkeypatch .delenv ("TASKCLUSTER_PROXY_URL" )
8787 monkeypatch .delenv ("TASK_ID" , raising = False )
8888 tc .get_root_url .cache_clear ()
89- with pytest .raises (RuntimeError ) as exc :
90- tc .get_artifact_url (task_id , path , use_proxy = True )
91- assert "taskcluster-proxy is not available when not executing in a task" in str (
92- exc .value
93- )
89+ assert tc .get_artifact_url (task_id , path , use_proxy = True ) == expected
9490
9591 # Test with use_proxy=True but proxy not enabled (in a task without proxy)
9692 monkeypatch .setenv ("TASK_ID" , "some-task-id" )
97- with pytest .raises (RuntimeError ) as exc :
98- tc .get_artifact_url (task_id , path , use_proxy = True )
99- assert "taskcluster-proxy is not enabled for this task" in str (exc .value )
93+ assert tc .get_artifact_url (task_id , path , use_proxy = True ) == expected
10094
10195
10296def test_get_artifact (responses , root_url ):
0 commit comments