Skip to content

Commit 77d8846

Browse files
Migrate TestInstall from test_lib.py to lib_test.go
1 parent ed0e364 commit 77d8846

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

internal/integrationtest/lib/lib_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,3 +512,21 @@ func TestLibDownload(t *testing.T) {
512512
_, _, err = cli.Run("lib", "download", "AudioZ")
513513
require.Error(t, err)
514514
}
515+
516+
func TestInstall(t *testing.T) {
517+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
518+
defer env.CleanUp()
519+
520+
libs := []string{"Arduino_BQ24195", "CMMC MQTT Connector", "WiFiNINA"}
521+
// Should be safe to run install multiple times
522+
_, _, err := cli.Run("lib", "install", libs[0], libs[1], libs[2])
523+
require.NoError(t, err)
524+
_, _, err = cli.Run("lib", "install", libs[0], libs[1], libs[2])
525+
require.NoError(t, err)
526+
527+
// Test failing-install of library with wrong dependency
528+
// (https://github.com/arduino/arduino-cli/issues/534)
529+
_, stderr, err := cli.Run("lib", "install", "MD_Parola@3.2.0")
530+
require.Error(t, err)
531+
require.Contains(t, string(stderr), "No valid dependencies solution found: dependency 'MD_MAX72xx' is not available")
532+
}

test/test_lib.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,6 @@ def download_lib(url, download_dir):
4949
z.close()
5050

5151

52-
def test_install(run_command):
53-
libs = ["Arduino_BQ24195", "CMMC MQTT Connector", "WiFiNINA"]
54-
# Should be safe to run install multiple times
55-
assert run_command(["lib", "install"] + libs)
56-
assert run_command(["lib", "install"] + libs)
57-
58-
# Test failing-install of library with wrong dependency
59-
# (https://github.com/arduino/arduino-cli/issues/534)
60-
res = run_command(["lib", "install", "MD_Parola@3.2.0"])
61-
assert res.failed
62-
assert "No valid dependencies solution found: dependency 'MD_MAX72xx' is not available" in res.stderr
63-
64-
6552
def test_install_library_with_dependencies(run_command):
6653
assert run_command(["update"])
6754

0 commit comments

Comments
 (0)