()
| 67 | } |
| 68 | |
| 69 | func (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 | |
| 95 | func (s *APISuite) SetUpSuite(c *C) { |
| 96 | err := s.setupContext() |
no test coverage detected