()
| 223 | } |
| 224 | |
| 225 | func (s *ImageDataTestSuite) TestDownloadInvalidImage() { |
| 226 | s.testServer().SetBody([]byte("invalid")) |
| 227 | |
| 228 | imgdata, _, err := s.factory().DownloadSync( |
| 229 | context.Background(), s.testServer().URL(), "Test image", imagedata.DownloadOptions{}, |
| 230 | ) |
| 231 | |
| 232 | s.Require().Error(err) |
| 233 | s.Require().Equal(http.StatusUnprocessableEntity, errctx.Wrap(err).StatusCode()) |
| 234 | s.Require().Nil(imgdata) |
| 235 | } |
| 236 | |
| 237 | func (s *ImageDataTestSuite) TestDownloadSourceAddressNotAllowed() { |
| 238 | s.fetcherCfg().Transport.HTTP.AllowLoopbackSourceAddresses = false |
nothing calls this directly
no test coverage detected