Skip to content

Commit 203b4c1

Browse files
Migrated TestCompletionPowershellNoDesc from test_completion.py to completion_test.go
1 parent a82a5e2 commit 203b4c1

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

internal/integrationtest/completion/completion_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,18 @@ func TestCompletionFishNoDesc(t *testing.T) {
154154
require.Contains(t, string(stdout), "function __arduino_cli_perform_completion")
155155
require.Contains(t, string(stdout), "__completeNoDesc")
156156
}
157+
158+
func TestCompletionPowershellNoDesc(t *testing.T) {
159+
env := testsuite.NewEnvironment(t)
160+
defer env.CleanUp()
161+
162+
cli := integrationtest.NewArduinoCliWithinEnvironment(env, &integrationtest.ArduinoCLIConfig{
163+
ArduinoCLIPath: paths.New("..", "..", "..", "arduino-cli"),
164+
UseSharedStagingFolder: true,
165+
})
166+
167+
stdout, stderr, err := cli.Run("completion", "powershell", "--no-descriptions")
168+
require.Error(t, err)
169+
require.Empty(t, stdout)
170+
require.Contains(t, string(stderr), "Error: command description is not supported by powershell")
171+
}

test/test_completion.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
# a commercial license, send an email to [email protected].
1515

1616

17-
def test_completion_powershell_no_desc(run_command):
18-
result = run_command(["completion", "powershell", "--no-descriptions"])
19-
assert not result.ok
20-
assert result.stdout == ""
21-
assert "Error: command description is not supported by powershell" in result.stderr
22-
23-
2417
# test if the completion suggestions returned are meaningful
2518
# we use the __complete hidden command
2619
# https://github.com/spf13/cobra/blob/master/shell_completions.md#debugging

0 commit comments

Comments
 (0)