(cb func(*conf.GlobalConfiguration, *storage.Connection))
| 44 | } |
| 45 | |
| 46 | func setupAPIForTestWithCallback(cb func(*conf.GlobalConfiguration, *storage.Connection)) (*API, *conf.GlobalConfiguration, error) { |
| 47 | config, err := confload.LoadGlobal(apiTestConfig) |
| 48 | if err != nil { |
| 49 | return nil, nil, err |
| 50 | } |
| 51 | |
| 52 | if cb != nil { |
| 53 | cb(config, nil) |
| 54 | } |
| 55 | |
| 56 | conn, err := test.SetupDBConnection(config) |
| 57 | if err != nil { |
| 58 | return nil, nil, err |
| 59 | } |
| 60 | |
| 61 | if cb != nil { |
| 62 | cb(nil, conn) |
| 63 | } |
| 64 | |
| 65 | limiterOpts := apilimiter.New(config) |
| 66 | return NewAPIWithVersion(config, conn, apiTestVersion, WithLimiter(limiterOpts)), config, nil |
| 67 | } |
| 68 | |
| 69 | func TestEmailEnabledByDefault(t *testing.T) { |
| 70 | api, _, err := setupAPIForTest() |
no test coverage detected
searching dependent graphs…