File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -168,3 +168,19 @@ func TestInstallToolV2(t *testing.T) {
168
168
})
169
169
}
170
170
}
171
+
172
+ func TestInstalledHead (t * testing.T ) {
173
+ indexURL := "https://downloads.arduino.cc/packages/package_staging_index.json"
174
+ // Instantiate Index
175
+ Index := index .Init (indexURL , config .GetDataDir ())
176
+
177
+ r := gin .New ()
178
+ goa := v2 .Server (config .GetDataDir ().String (), Index )
179
+ r .Any ("/v2/*path" , gin .WrapH (goa ))
180
+ ts := httptest .NewServer (r )
181
+
182
+ resp , err := http .Head (ts .URL + "/v2/pkgs/tools/installed" )
183
+ require .NoError (t , err )
184
+ require .NotEqual (t , resp .StatusCode , http .StatusMethodNotAllowed )
185
+ require .Equal (t , resp .StatusCode , http .StatusOK )
186
+ }
Original file line number Diff line number Diff line change @@ -185,6 +185,22 @@ func TestEvilFilename(t *testing.T) {
185
185
}
186
186
}
187
187
188
+ func TestInstalledHead (t * testing.T ) {
189
+ // Initialize indexes with a temp folder
190
+ tmp := t .TempDir ()
191
+
192
+ indexURL := "https://downloads.arduino.cc/packages/package_staging_index.json"
193
+ // Instantiate Index
194
+ Index := index .Init (indexURL , config .GetDataDir ())
195
+
196
+ service := pkgs .New (Index , tmp )
197
+
198
+ ctx := context .Background ()
199
+
200
+ err := service .Installedhead (ctx )
201
+ require .NoError (t , err )
202
+ }
203
+
188
204
func strpoint (s string ) * string {
189
205
return & s
190
206
}
You can’t perform that action at this time.
0 commit comments