refactor(deploy): drop redundant _validate_project_structure

This commit is contained in:
Greyson Lalonde
2026-05-05 05:10:00 +08:00
parent 94bd89f4e2
commit dc9e033571
3 changed files with 3 additions and 50 deletions

View File

@@ -15,10 +15,8 @@ class TestDeployCommand(unittest.TestCase):
@patch("crewai_cli.command.get_auth_token")
@patch("crewai_cli.deploy.main.get_project_name")
@patch("crewai_cli.command.PlusAPI")
@patch.object(DeployCommand, "_validate_project_structure")
def setUp(
self,
mock_validate_structure,
mock_plus_api,
mock_get_project_name,
mock_get_auth_token,
@@ -125,9 +123,8 @@ class TestDeployCommand(unittest.TestCase):
)
self.assertIn("2023-01-01 - INFO: Test log", fake_out.getvalue())
@patch.object(DeployCommand, "_validate_project_structure")
@patch("crewai_cli.deploy.main.DeployCommand._display_deployment_info")
def test_deploy_with_uuid(self, mock_display, mock_validate_structure):
def test_deploy_with_uuid(self, mock_display):
mock_response = MagicMock()
mock_response.status_code = 200
mock_response.json.return_value = {"uuid": "test-uuid"}
@@ -138,9 +135,8 @@ class TestDeployCommand(unittest.TestCase):
self.mock_client.deploy_by_uuid.assert_called_once_with("test-uuid")
mock_display.assert_called_once_with({"uuid": "test-uuid"})
@patch.object(DeployCommand, "_validate_project_structure")
@patch("crewai_cli.deploy.main.DeployCommand._display_deployment_info")
def test_deploy_with_project_name(self, mock_display, mock_validate_structure):
def test_deploy_with_project_name(self, mock_display):
mock_response = MagicMock()
mock_response.status_code = 200
mock_response.json.return_value = {"uuid": "test-uuid"}
@@ -151,13 +147,10 @@ class TestDeployCommand(unittest.TestCase):
self.mock_client.deploy_by_name.assert_called_once_with("test_project")
mock_display.assert_called_once_with({"uuid": "test-uuid"})
@patch.object(DeployCommand, "_validate_project_structure")
@patch("crewai_cli.deploy.main.fetch_and_json_env_file")
@patch("crewai_cli.deploy.main.git.Repository.origin_url")
@patch("builtins.input")
def test_create_crew(
self, mock_input, mock_git_origin_url, mock_fetch_env, mock_validate_structure
):
def test_create_crew(self, mock_input, mock_git_origin_url, mock_fetch_env):
mock_fetch_env.return_value = {"ENV_VAR": "value"}
mock_git_origin_url.return_value = "https://github.com/test/repo.git"
mock_input.return_value = ""