@@ -30,6 +30,28 @@ async def test_mark_as_shipped(context, monkeypatch, scopes):
3030 )
3131
3232
33+ @pytest .mark .parametrize ("scopes" , (["project:releng:ship-it:action:mark-as-merged" , "project:releng:ship-it:server:dev" ],))
34+ @pytest .mark .asyncio
35+ async def test_mark_as_merged (context , monkeypatch , scopes ):
36+ context .task ["scopes" ] = scopes
37+ context .task ["payload" ] = {"automation_id" : 123 }
38+
39+ mark_as_merged_mock = MagicMock ()
40+ monkeypatch .setattr (ship_actions , "mark_as_merged" , mark_as_merged_mock )
41+
42+ await script .async_main (context )
43+ mark_as_merged_mock .assert_called_with (
44+ {
45+ "scope" : scopes [- 1 ],
46+ "api_root_v2" : "http://some-ship-it.url/v2" ,
47+ "timeout_in_seconds" : 1 ,
48+ "taskcluster_client_id" : "some-id" ,
49+ "taskcluster_access_token" : "some-token" ,
50+ },
51+ 123 ,
52+ )
53+
54+
3355@pytest .mark .parametrize (
3456 "task,raises" ,
3557 (
@@ -79,6 +101,7 @@ def test_get_default_config():
79101 "work_dir" : os .path .join (parent_dir , "work_dir" ),
80102 "verbose" : False ,
81103 "mark_as_shipped_schema_file" : os .path .join (data_dir , "mark_as_shipped_task_schema.json" ),
104+ "mark_as_merged_schema_file" : os .path .join (data_dir , "mark_as_merged_task_schema.json" ),
82105 "create_new_release_schema_file" : os .path .join (data_dir , "create_new_release_task_schema.json" ),
83106 }
84107
0 commit comments