Add Git validations for publishing tools (#1381)

This commit prevents tools from being published if the underlying Git
repository is unsynced with origin.
This commit is contained in:
Vini Brasil
2024-10-02 11:46:18 -03:00
committed by GitHub
parent 01329a01ab
commit dd0b622826
9 changed files with 235 additions and 53 deletions

View File

@@ -143,11 +143,11 @@ class TestDeployCommand(unittest.TestCase):
mock_display.assert_called_once_with({"uuid": "test-uuid"})
@patch("crewai.cli.deploy.main.fetch_and_json_env_file")
@patch("crewai.cli.deploy.main.get_git_remote_url")
@patch("crewai.cli.deploy.main.git.Repository.origin_url")
@patch("builtins.input")
def test_create_crew(self, mock_input, mock_get_git_remote_url, mock_fetch_env):
def test_create_crew(self, mock_input, mock_git_origin_url, mock_fetch_env):
mock_fetch_env.return_value = {"ENV_VAR": "value"}
mock_get_git_remote_url.return_value = "https://github.com/test/repo.git"
mock_git_origin_url.return_value = "https://github.com/test/repo.git"
mock_input.return_value = ""
mock_response = MagicMock()