Skip to content

Commit 1562879

Browse files
Migrate TestInstallNoDeps from test_lib.py to lib_test.go
1 parent f46f0c2 commit 1562879

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

internal/integrationtest/lib/lib_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,3 +568,25 @@ func TestInstallLibraryWithDependencies(t *testing.T) {
568568
_, _, err = cli.Run("lib", "install", "Arduino_Builtin", "--no-overwrite")
569569
require.Error(t, err)
570570
}
571+
572+
func TestInstallNoDeps(t *testing.T) {
573+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
574+
defer env.CleanUp()
575+
576+
_, _, err := cli.Run("update")
577+
require.NoError(t, err)
578+
579+
// Verifies libraries are not installed
580+
stdout, _, err := cli.Run("lib", "list", "--format", "json")
581+
require.NoError(t, err)
582+
requirejson.Empty(t, stdout)
583+
584+
// Install library skipping dependencies installation
585+
_, _, err = cli.Run("lib", "install", "MD_Parola@3.5.5", "--no-deps")
586+
require.NoError(t, err)
587+
588+
// Verifies library's dependencies are not installed
589+
stdout, _, err = cli.Run("lib", "list", "--format", "json")
590+
require.NoError(t, err)
591+
requirejson.Query(t, stdout, ".[] | .library | .name", "\"MD_Parola\"")
592+
}

test/test_lib.py

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

5151

52-
def test_install_no_deps(run_command):
53-
assert run_command(["update"])
54-
55-
# Verifies libraries are not installed
56-
res = run_command(["lib", "list", "--format", "json"])
57-
assert res.ok
58-
data = json.loads(res.stdout)
59-
installed_libraries = [l["library"]["name"] for l in data]
60-
assert "MD_Parola" not in installed_libraries
61-
assert "MD_MAX72XX" not in installed_libraries
62-
63-
# Install library skipping dependencies installation
64-
assert run_command(["lib", "install", "MD_Parola@3.5.5", "--no-deps"])
65-
66-
# Verifies library's dependencies are not installed
67-
res = run_command(["lib", "list", "--format", "json"])
68-
assert res.ok
69-
data = json.loads(res.stdout)
70-
installed_libraries = [l["library"]["name"] for l in data]
71-
assert "MD_Parola" in installed_libraries
72-
assert "MD_MAX72XX" not in installed_libraries
73-
74-
7552
def test_install_git_url_and_zip_path_flags_visibility(run_command, data_dir, downloads_dir):
7653
# Verifies installation fail because flags are not found
7754
git_url = "https://github.com/arduino-libraries/WiFi101.git"

0 commit comments

Comments
 (0)