newTestService stands up a ConfigService backed by a tmp dir so the file IO is real but isolated. The model loader is loaded against the same tmp path so GetModelConfig works.
()
| 17 | // is real but isolated. The model loader is loaded against the same tmp path |
| 18 | // so GetModelConfig works. |
| 19 | func newTestService() (*ConfigService, string) { |
| 20 | dir := GinkgoT().TempDir() |
| 21 | loader := config.NewModelConfigLoader(dir) |
| 22 | appConfig := &config.ApplicationConfig{ |
| 23 | SystemState: &system.SystemState{Model: system.Model{ModelsPath: dir}}, |
| 24 | } |
| 25 | return NewConfigService(loader, appConfig), dir |
| 26 | } |
| 27 | |
| 28 | // writeModelYAML creates a model YAML on disk and reloads the loader so the |
| 29 | // new entry is visible. |
no test coverage detected