Skip to content

Commit 03a34b7

Browse files
committed
Add tests to cover new workspace CLI args
Signed-off-by: lelia <lelia@socket.dev>
1 parent 2b96caf commit 03a34b7

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

tests/unit/test_cli_config.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,25 @@ def test_strict_blocking_with_disable_blocking(self):
6060
"--disable-blocking"
6161
])
6262
assert config.strict_blocking is True
63-
assert config.disable_blocking is True
63+
assert config.disable_blocking is True
64+
65+
def test_workspace_flag(self):
66+
"""Test that --workspace is parsed and stored correctly."""
67+
config = CliConfig.from_args(["--api-token", "test", "--workspace", "grofers"])
68+
assert config.workspace == "grofers"
69+
70+
def test_workspace_default_is_none(self):
71+
"""Test that workspace defaults to None when not supplied."""
72+
config = CliConfig.from_args(["--api-token", "test"])
73+
assert config.workspace is None
74+
75+
def test_workspace_is_independent_of_workspace_name(self):
76+
"""--workspace and --workspace-name are distinct flags with distinct purposes."""
77+
config = CliConfig.from_args([
78+
"--api-token", "test",
79+
"--workspace", "grofers",
80+
"--sub-path", ".",
81+
"--workspace-name", "monorepo-suffix",
82+
])
83+
assert config.workspace == "grofers"
84+
assert config.workspace_name == "monorepo-suffix"

0 commit comments

Comments
 (0)