mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-02 05:38:12 +00:00
Update crewAI CLI with various enhancements and fixes
- Updated `create_json_crew.py` to require `crewai[tools]>=1.14.7`. - Enhanced `git.py` with improved repository initialization, including automatic initial commit creation and exclusion patterns for initial commits. - Modified `install_crew.py` to allow error handling during installation with an optional `raise_on_error` parameter. - Expanded `plus_api.py` to include methods for creating and updating crews from ZIP files. - Introduced a new `archive.py` for creating deployable ZIP archives of CrewAI projects, ensuring local artifacts are excluded. - Updated `run_crew.py` to manage JSON crew dependencies and run crews in the project's environment. - Enhanced deployment logic in `main.py` to handle ZIP uploads and improve user feedback during deployment processes. - Added tests for new functionalities and ensured existing tests reflect recent changes in behavior and requirements.
This commit is contained in:
@@ -292,6 +292,36 @@ class TestPlusAPI(unittest.TestCase):
|
||||
"POST", "/crewai_plus/api/v1/crews", json=payload
|
||||
)
|
||||
|
||||
@patch("crewai_cli.plus_api.PlusAPI._make_multipart_request")
|
||||
def test_create_crew_from_zip(self, mock_make_multipart_request):
|
||||
self.api.create_crew_from_zip(
|
||||
"/tmp/test.zip",
|
||||
name="test_crew",
|
||||
env={"ENV_VAR": "value"},
|
||||
)
|
||||
mock_make_multipart_request.assert_called_once_with(
|
||||
"POST",
|
||||
"/crewai_plus/api/v1/crews/zip",
|
||||
zip_file_path="/tmp/test.zip",
|
||||
data={"name": "test_crew", "env[ENV_VAR]": "value"},
|
||||
timeout=300,
|
||||
)
|
||||
|
||||
@patch("crewai_cli.plus_api.PlusAPI._make_multipart_request")
|
||||
def test_update_crew_from_zip(self, mock_make_multipart_request):
|
||||
self.api.update_crew_from_zip(
|
||||
"test_uuid",
|
||||
"/tmp/test.zip",
|
||||
env={"ENV_VAR": "value"},
|
||||
)
|
||||
mock_make_multipart_request.assert_called_once_with(
|
||||
"POST",
|
||||
"/crewai_plus/api/v1/crews/test_uuid/zip_update",
|
||||
zip_file_path="/tmp/test.zip",
|
||||
data={"env[ENV_VAR]": "value"},
|
||||
timeout=300,
|
||||
)
|
||||
|
||||
@patch("crewai_core.plus_api.Settings")
|
||||
@patch.dict(os.environ, {"CREWAI_PLUS_URL": ""})
|
||||
def test_custom_base_url(self, mock_settings_class):
|
||||
|
||||
Reference in New Issue
Block a user