MCPcopy Index your code
hub / github.com/aptly-dev/aptly / createTestConfig

Function createTestConfig

api/api_test.go:37–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35var _ = Suite(&APISuite{})
36
37func 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
69func (s *APISuite) setupContext() error {
70 aptly.Version = "testVersion"

Callers 1

setupContextMethod · 0.85

Calls 1

WriteMethod · 0.65

Tested by

no test coverage detected