Skip to content

Commit 9120ec3

Browse files
Migrate TestUpdateShowingOutdatedUsingLibraryWithInvalidVersion to update_test.go and delete test_update.py
1 parent 6755fe6 commit 9120ec3

File tree

2 files changed

+27
-38
lines changed

2 files changed

+27
-38
lines changed

internal/integrationtest/update/update_test.go

+27
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,30 @@ func TestUpdateWithUrlInternalServerError(t *testing.T) {
127127
require.Error(t, err)
128128
require.Contains(t, string(stdout), "Downloading index: test_index.json Server responded with: 500 Internal Server Error")
129129
}
130+
131+
func TestUpdateShowingOutdatedUsingLibraryWithInvalidVersion(t *testing.T) {
132+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
133+
defer env.CleanUp()
134+
135+
_, _, err := cli.Run("update")
136+
require.NoError(t, err)
137+
138+
// Install latest version of a library
139+
_, _, err = cli.Run("lib", "install", "WiFi101")
140+
require.NoError(t, err)
141+
142+
// Verifies library doesn't get updated
143+
stdout, _, err := cli.Run("update", "--show-outdated")
144+
require.NoError(t, err)
145+
require.NotContains(t, string(stdout), "WiFi101")
146+
147+
// Changes the version of the currently installed library so that it's
148+
// invalid
149+
libPath := cli.SketchbookDir().Join("libraries", "WiFi101", "library.properties")
150+
require.NoError(t, libPath.WriteFile([]byte("name=WiFi101\nversion=1.0001")))
151+
152+
// Verifies library gets updated
153+
stdout, _, err = cli.Run("update", "--show-outdated")
154+
require.NoError(t, err)
155+
require.Contains(t, string(stdout), "WiFi101")
156+
}

test/test_update.py

-38
This file was deleted.

0 commit comments

Comments
 (0)