| 35 | var _ = Suite(&APISuite{}) |
| 36 | |
| 37 | func createTestConfig() *os.File { |
| 38 | file, err := os.CreateTemp("", "aptly") |
| 39 | if err != nil { |
| 40 | return nil |
| 41 | } |
| 42 | jsonString, err := json.Marshal(gin.H{ |
| 43 | "architectures": []string{}, |
| 44 | "enableMetricsEndpoint": true, |
| 45 | "S3PublishEndpoints": map[string]map[string]string{ |
| 46 | "test-s3": { |
| 47 | "region": "us-east-1", |
| 48 | "bucket": "bucket-s3", |
| 49 | }, |
| 50 | }, |
| 51 | "GcsPublishEndpoints": map[string]map[string]string{ |
| 52 | "test-gcs": { |
| 53 | "bucket": "bucket-gcs", |
| 54 | }, |
| 55 | }, |
| 56 | "JFrogPublishEndpoints": map[string]map[string]string{ |
| 57 | "test-jfrog": { |
| 58 | "url": "http://jfrog.example.com", |
| 59 | }, |
| 60 | }, |
| 61 | }) |
| 62 | if err != nil { |
| 63 | return nil |
| 64 | } |
| 65 | _, _ = file.Write(jsonString) |
| 66 | return file |
| 67 | } |
| 68 | |
| 69 | func (s *APISuite) setupContext() error { |
| 70 | aptly.Version = "testVersion" |