88from gardenlinux .constants import GARDENLINUX_GITHUB_RELEASE_BUCKET_NAME
99
1010from ..constants import TEST_GARDENLINUX_COMMIT , TEST_GARDENLINUX_RELEASE
11- from .constants import RELEASE_JSON , REPO_JSON
11+ from .constants import RELEASE_JSON , REPO_JSON , TEST_GARDENLINUX_RELEASE_ID
1212
1313
1414def test_script_parse_args_wrong_command (
@@ -145,7 +145,7 @@ def test_script_upload_needs_github_token(
145145 "--repo" ,
146146 "gardenlinux" ,
147147 "--release_id" ,
148- TEST_GARDENLINUX_RELEASE ,
148+ str ( TEST_GARDENLINUX_RELEASE_ID ) ,
149149 "--file_path" ,
150150 str (artifact_for_upload ),
151151 "--dry-run" ,
@@ -190,7 +190,7 @@ def test_script_upload_dry_run(
190190 )
191191
192192 m .get (
193- f"//api.github.com:443/repos/gardenlinux/gardenlinux/releases/tags/ { TEST_GARDENLINUX_RELEASE } " ,
193+ f"//api.github.com:443/repos/gardenlinux/gardenlinux/releases/{ TEST_GARDENLINUX_RELEASE_ID } " ,
194194 json = RELEASE_JSON ,
195195 status_code = 200 ,
196196 )
@@ -206,7 +206,7 @@ def test_script_upload_dry_run(
206206 "--repo" ,
207207 "gardenlinux" ,
208208 "--release_id" ,
209- TEST_GARDENLINUX_RELEASE ,
209+ str ( TEST_GARDENLINUX_RELEASE_ID ) ,
210210 "--file_path" ,
211211 str (artifact_for_upload ),
212212 "--dry-run" ,
@@ -237,23 +237,11 @@ def test_script_upload_inaccessible_file(
237237 )
238238
239239 m .get (
240- "//api.github.com:443/repos/gardenlinux/gardenlinux/releases/1 " ,
240+ f "//api.github.com:443/repos/gardenlinux/gardenlinux/releases/{ TEST_GARDENLINUX_RELEASE_ID } " ,
241241 json = RELEASE_JSON ,
242242 status_code = 200 ,
243243 )
244244
245- m .get (
246- f"//api.github.com:443/repos/gardenlinux/gardenlinux/releases/tags/{ TEST_GARDENLINUX_RELEASE } " ,
247- json = RELEASE_JSON ,
248- status_code = 200 ,
249- )
250-
251- m .post (
252- f"//uploads.github.com:443/repos/gardenlinux/gardenlinux/releases/{ TEST_GARDENLINUX_RELEASE } /assets?name=artifact.log" ,
253- text = "{}" ,
254- status_code = 201 ,
255- )
256-
257245 monkeypatch .setattr (
258246 sys ,
259247 "argv" ,
@@ -265,7 +253,7 @@ def test_script_upload_inaccessible_file(
265253 "--repo" ,
266254 "gardenlinux" ,
267255 "--release_id" ,
268- TEST_GARDENLINUX_RELEASE ,
256+ str ( TEST_GARDENLINUX_RELEASE_ID ) ,
269257 "--file_path" ,
270258 str (artifact_for_upload ),
271259 ],
@@ -289,19 +277,13 @@ def test_script_upload(
289277 )
290278
291279 m .get (
292- "//api.github.com:443/repos/gardenlinux/gardenlinux/releases/1" ,
293- json = RELEASE_JSON ,
294- status_code = 200 ,
295- )
296-
297- m .get (
298- f"//api.github.com:443/repos/gardenlinux/gardenlinux/releases/tags/{ TEST_GARDENLINUX_RELEASE } " ,
280+ f"//api.github.com:443/repos/gardenlinux/gardenlinux/releases/{ TEST_GARDENLINUX_RELEASE_ID } " ,
299281 json = RELEASE_JSON ,
300282 status_code = 200 ,
301283 )
302284
303285 m .post (
304- "//uploads.github.com:443/repos/gardenlinux/gardenlinux/releases/1 /assets?label=&name=artifact.log" ,
286+ f "//uploads.github.com:443/repos/gardenlinux/gardenlinux/releases/{ TEST_GARDENLINUX_RELEASE_ID } /assets?label=&name=artifact.log" ,
305287 json = {},
306288 status_code = 201 ,
307289 )
@@ -317,7 +299,7 @@ def test_script_upload(
317299 "--repo" ,
318300 "gardenlinux" ,
319301 "--release_id" ,
320- TEST_GARDENLINUX_RELEASE ,
302+ str ( TEST_GARDENLINUX_RELEASE_ID ) ,
321303 "--file_path" ,
322304 str (artifact_for_upload ),
323305 ],
0 commit comments