Skip to content

Commit ed0e364

Browse files
Migrate TestLibDownload from test_lib.py to lib_test.go
1 parent 12153ec commit ed0e364

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

internal/integrationtest/lib/lib_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,3 +494,21 @@ func TestListProvidesIncludesFallback(t *testing.T) {
494494
]
495495
}`)
496496
}
497+
498+
func TestLibDownload(t *testing.T) {
499+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
500+
defer env.CleanUp()
501+
502+
// Download a specific lib version
503+
_, _, err := cli.Run("lib", "download", "AudioZero@1.0.0")
504+
require.NoError(t, err)
505+
require.FileExists(t, cli.DownloadDir().Join("libraries", "AudioZero-1.0.0.zip").String())
506+
507+
// Wrong lib version
508+
_, _, err = cli.Run("lib", "download", "AudioZero@69.42.0")
509+
require.Error(t, err)
510+
511+
// Wrong lib
512+
_, _, err = cli.Run("lib", "download", "AudioZ")
513+
require.Error(t, err)
514+
}

test/test_lib.py

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

5151

52-
def test_lib_download(run_command, downloads_dir):
53-
54-
# Download a specific lib version
55-
assert run_command(["lib", "download", "AudioZero@1.0.0"])
56-
assert Path(downloads_dir, "libraries", "AudioZero-1.0.0.zip").exists()
57-
58-
# Wrong lib version
59-
result = run_command(["lib", "download", "AudioZero@69.42.0"])
60-
assert result.failed
61-
62-
# Wrong lib
63-
result = run_command(["lib", "download", "AudioZ"])
64-
assert result.failed
65-
66-
6752
def test_install(run_command):
6853
libs = ["Arduino_BQ24195", "CMMC MQTT Connector", "WiFiNINA"]
6954
# Should be safe to run install multiple times

0 commit comments

Comments
 (0)