Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit fb74a6e

Browse files
unit test fixes
1 parent a099f02 commit fb74a6e

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/codegate/pipeline/cli/commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ async def _add_workspace(self, flags: Dict[str, str], args: List[str]) -> str:
156156
Add a workspace
157157
"""
158158
if args is None or len(args) == 0:
159-
return "Please provide a name. Use `codegate workspace add <workspace_name>`"
159+
return "Please provide a name. Use `codegate workspace add your_workspace_name`"
160160

161161
new_workspace_name = args[0]
162162
if not new_workspace_name:
163-
return "Please provide a name. Use `codegate workspace add <workspace_name>`"
163+
return "Please provide a name. Use `codegate workspace add your_workspace_name`"
164164

165165
try:
166166
_ = await self.workspace_crud.add_workspace(new_workspace_name)
@@ -178,11 +178,11 @@ async def _activate_workspace(self, flags: Dict[str, str], args: List[str]) -> s
178178
Activate a workspace
179179
"""
180180
if args is None or len(args) == 0:
181-
return "Please provide a name. Use `codegate workspace activate <workspace_name>`"
181+
return "Please provide a name. Use `codegate workspace activate workspace_name`"
182182

183183
workspace_name = args[0]
184184
if not workspace_name:
185-
return "Please provide a name. Use `codegate workspace activate <workspace_name>`"
185+
return "Please provide a name. Use `codegate workspace activate workspace_name`"
186186

187187
try:
188188
await self.workspace_crud.activate_workspace(workspace_name)

tests/pipeline/workspace/test_workspace.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async def test_list_workspaces(mock_workspaces, expected_output):
4242
workspace_commands.workspace_crud.get_workspaces = mock_get_workspaces
4343

4444
# Call the method
45-
result = await workspace_commands._list_workspaces()
45+
result = await workspace_commands._list_workspaces(None, None)
4646

4747
# Check the result
4848
assert result == expected_output
@@ -54,11 +54,11 @@ async def test_list_workspaces(mock_workspaces, expected_output):
5454
"args, existing_workspaces, expected_message",
5555
[
5656
# Case 1: No workspace name provided
57-
([], [], "Please provide a name. Use `codegate workspace add <workspace_name>`"),
57+
([], [], "Please provide a name. Use `codegate workspace add your_workspace_name`"),
5858
# Case 2: Workspace name is empty string
59-
([""], [], "Please provide a name. Use `codegate workspace add <workspace_name>`"),
59+
([""], [], "Please provide a name. Use `codegate workspace add your_workspace_name`"),
6060
# Case 3: Successful add
61-
(["myworkspace"], [], "Workspace `myworkspace` has been added"),
61+
(["myworkspace"], [], "Workspace **myworkspace** has been added"),
6262
],
6363
)
6464
async def test_add_workspaces(args, existing_workspaces, expected_message):
@@ -83,7 +83,7 @@ async def test_add_workspaces(args, existing_workspaces, expected_message):
8383
mock_recorder.add_workspace = AsyncMock()
8484

8585
# Call the method
86-
result = await workspace_commands._add_workspace(args)
86+
result = await workspace_commands._add_workspace(None, args)
8787

8888
# Assertions
8989
assert result == expected_message

0 commit comments

Comments
 (0)