Skip to content

Commit e28ecf9

Browse files
committed
add test
1 parent 144a904 commit e28ecf9

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

v2/pkgs/tools_test.go

+25
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,28 @@ func TestInstalledHead(t *testing.T) {
204204
func strpoint(s string) *string {
205205
return &s
206206
}
207+
208+
func TestInstall(t *testing.T) {
209+
// Initialize indexes with a temp folder
210+
tmp := t.TempDir()
211+
212+
indexURL := "https://downloads.arduino.cc/packages/package_staging_index.json"
213+
// Instantiate Index
214+
Index := index.Init(indexURL, config.GetDataDir())
215+
216+
service := pkgs.New(Index, tmp)
217+
218+
ctx := context.Background()
219+
220+
avrdude := tools.ToolPayload{
221+
Name: "avrdude",
222+
Packager: "arduino",
223+
Version: "6.3.0-arduino17",
224+
Checksum: strpoint("SHA-256:120cc9edaae699e7e9ac50b1b8eb0e7d51fdfa555bac54233c2511e6ee5418c9"),
225+
Signature: strpoint("9e026bb164854f3e348c3d8f0ed48617359a2cc27bd7f523620552b640687870c2e604a15e7d6398c1f6bf9b5e17533e5d437e84ae6418fe51881082c1d4a90b831ea804f2d1c364f5b9bf47ac2aa048229f0f18cba4d2655a69c12e06013f416b02ac3294b3c274756ed80b8df041f8d2aec3969b1ac88070347287f8a2904d02c4ada7b6f290a2385b216930ce2ca4842cea05ef0b5c9a25267bdab55597963ff62471fd87ebe08aaf1dd8aa90c6c75caf952b7c2f6c4c388364c3b206f795cc9dd49167d38954b1bdf6c82eb07f91d1f4d016a75c87d283eebdfadb3dbd9a1b7b55851e1332bea2a9c52cbec8ede757640e02c6611ac7cae59af1a1a00fc4"),
226+
URL: strpoint("http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino17-x86_64-apple-darwin12.tar.bz2"),
227+
}
228+
229+
_, err := service.Install(ctx, &avrdude)
230+
require.NoError(t, err)
231+
}

0 commit comments

Comments
 (0)