@@ -151,6 +151,29 @@ def test_publish_nothing_to_publish_raises(
151151 mock_publish_dataset .assert_called_once ()
152152 mock_generate_workflow_experiment_records .assert_not_called ()
153153
154+ @patch .object (Publisher , "publish_dataset" , return_value = {"x" : {}})
155+ @patch .object (
156+ Publisher , "generate_workflow_experiment_records" , return_value = {"y" : {}}
157+ )
158+ def test_publish_builds_pr_params (self , mock_wf , mock_ds ):
159+ # Make PR creation return a fixed URL
160+ self .publisher .gh_publisher .publish_files .return_value = "PR_URL"
161+
162+ # Provide IDs for commit/PR labels
163+ self .publisher .collection_id = "col"
164+ self .publisher .workflow_id = "wf"
165+
166+ url = self .publisher .publish (write_to_file = False , mode = "all" )
167+ assert url == "PR_URL"
168+
169+ # Inspect the call arguments to publish_files
170+ _ , kwargs = self .publisher .gh_publisher .publish_files .call_args
171+ assert "dataset: col" in kwargs ["commit_message" ]
172+ assert "workflow/experiment: wf" in kwargs ["commit_message" ]
173+ assert "dataset: col" in kwargs ["pr_title" ]
174+ assert "workflow/experiment: wf" in kwargs ["pr_title" ]
175+
176+
154177class TestParseGithubNotebookUrl :
155178 @pytest .mark .parametrize (
156179 "url,repo_url,repo_name,branch,file_path" ,
0 commit comments