Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 61f9eb4

Browse files
committedAug 18, 2022
Migrated TestConfigCompletion from test_completion.py to completion_test.go
1 parent b56f331 commit 61f9eb4

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed
 

‎internal/integrationtest/completion/completion_test.go

+20
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,23 @@ func TestStaticCompletions(t *testing.T) {
193193
stdout, _, _ = cli.Run("__complete", "--log-level", "")
194194
require.Contains(t, string(stdout), "trace")
195195
}
196+
197+
// here we test if the completions coming from the core are working
198+
func TestConfigCompletion(t *testing.T) {
199+
env := testsuite.NewEnvironment(t)
200+
defer env.CleanUp()
201+
202+
cli := integrationtest.NewArduinoCliWithinEnvironment(env, &integrationtest.ArduinoCLIConfig{
203+
ArduinoCLIPath: paths.New("..", "..", "..", "arduino-cli"),
204+
UseSharedStagingFolder: true,
205+
})
206+
207+
stdout, _, _ := cli.Run("__complete", "config", "add", "")
208+
require.Contains(t, string(stdout), "board_manager.additional_urls")
209+
stdout, _, _ = cli.Run("__complete", "config", "remove", "")
210+
require.Contains(t, string(stdout), "board_manager.additional_urls")
211+
stdout, _, _ = cli.Run("__complete", "config", "delete", "")
212+
require.Contains(t, string(stdout), "board_manager.additional_urls")
213+
stdout, _, _ = cli.Run("__complete", "config", "set", "")
214+
require.Contains(t, string(stdout), "board_manager.additional_urls")
215+
}

‎test/test_completion.py

-12
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,6 @@
1414
# a commercial license, send an email to license@arduino.cc.
1515

1616

17-
# here we test if the completions coming from the core are working
18-
def test_config_completion(run_command):
19-
result = run_command(["__complete", "config", "add", ""])
20-
assert "board_manager.additional_urls" in result.stdout
21-
result = run_command(["__complete", "config", "remove", ""])
22-
assert "board_manager.additional_urls" in result.stdout
23-
result = run_command(["__complete", "config", "delete", ""])
24-
assert "board_manager.additional_urls" in result.stdout
25-
result = run_command(["__complete", "config", "set", ""])
26-
assert "board_manager.additional_urls" in result.stdout
27-
28-
2917
# here we test if the completions coming from the libs are working
3018
def test_lib_completion(run_command):
3119
assert run_command(["lib", "update-index"])

0 commit comments

Comments
 (0)