@@ -137,6 +137,53 @@ def test_run_github_action_update_readme(
137137 mock_update_readme .assert_called_once ()
138138
139139
140+ @patch ('homebrew_releaser.app.HOMEBREW_TAP' , '123' )
141+ @patch ('homebrew_releaser.app.UPDATE_PYTHON_RESOURCES' , True )
142+ @patch ('homebrew_releaser.checksum.Checksum.upload_checksum_file' )
143+ @patch ('woodchips.get' )
144+ @patch ('homebrew_releaser.git.Git.setup' )
145+ @patch ('homebrew_releaser.git.Git.add' )
146+ @patch ('homebrew_releaser.git.Git.commit' )
147+ @patch ('homebrew_releaser.git.Git.push' )
148+ @patch ('homebrew_releaser.utils.Utils.write_file' )
149+ @patch ('homebrew_releaser.formula.Formula.generate_formula_data' )
150+ @patch ('homebrew_releaser.formula.Formula.update_python_resources' )
151+ @patch ('homebrew_releaser.checksum.Checksum.get_checksum' , return_value = ('123' , 'mock-repo' ))
152+ @patch ('homebrew_releaser.app.App.download_archive' )
153+ @patch ('homebrew_releaser.utils.Utils.make_github_get_request' )
154+ @patch ('homebrew_releaser.app.App.check_required_env_variables' )
155+ def test_run_github_action_update_python_resources (
156+ mock_check_env_variables ,
157+ mock_make_github_get_request ,
158+ mock_download_archive ,
159+ mock_get_checksum ,
160+ mock_generate_formula ,
161+ mock_write_file ,
162+ mock_push_formula ,
163+ mock_commit_formula ,
164+ mock_add_formula ,
165+ mock_setup_git ,
166+ mock_logger ,
167+ mock_upload_checksum_file ,
168+ mock_update_python_resources ,
169+ ):
170+ App .run_github_action ()
171+
172+ # TODO: Assert these `called_with` eventually
173+ mock_logger .assert_called ()
174+ mock_check_env_variables .assert_called_once ()
175+ assert mock_make_github_get_request .call_count == 2
176+ mock_download_archive .call_count == 2
177+ mock_get_checksum .call_count == 2
178+ mock_generate_formula .assert_called_once ()
179+ mock_write_file .call_count == 2
180+ mock_setup_git .assert_called_once ()
181+ mock_add_formula .assert_called_once ()
182+ mock_commit_formula .assert_called_once ()
183+ mock_push_formula .assert_called_once ()
184+ mock_update_python_resources .assert_called_once ()
185+
186+
140187@patch ('homebrew_releaser.app.HOMEBREW_TAP' , '123' )
141188@patch ('homebrew_releaser.app.TARGET_DARWIN_AMD64' , True )
142189@patch ('homebrew_releaser.app.TARGET_DARWIN_ARM64' , True )
0 commit comments