MCPcopy Create free account
hub / github.com/aptly-dev/aptly / setupContext

Method setupContext

api/api_test.go:69–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67}
68
69func (s *APISuite) setupContext() error {
70 aptly.Version = "testVersion"
71 file := createTestConfig()
72 if nil == file {
73 return fmt.Errorf("unable to create the test configuration file")
74 }
75 s.configFile = file
76
77 flags := flag.NewFlagSet("fakeFlags", flag.ContinueOnError)
78 flags.Bool("no-lock", false, "dummy")
79 flags.Int("db-open-attempts", 3, "dummy")
80 flags.String("config", s.configFile.Name(), "dummy")
81 flags.String("architectures", "", "dummy")
82 s.flags = flags
83
84 context, err := ctx.NewContext(s.flags)
85 if nil != err {
86 return err
87 }
88
89 s.context = context
90 s.router = Router(context)
91
92 return nil
93}
94
95func (s *APISuite) SetUpSuite(c *C) {
96 err := s.setupContext()

Callers 1

SetUpSuiteMethod · 0.95

Calls 3

createTestConfigFunction · 0.85
RouterFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected