diff options
author | Wolfy-J <[email protected]> | 2019-12-23 14:43:47 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2019-12-23 14:43:47 +0300 |
commit | c7b0a4a81827284f7565c56aa476eea34fb6382f (patch) | |
tree | ee30e93169c37fb058fbe55af6b3f954eabd9646 /service/container_test.go | |
parent | 7f694966730f6dac09d0d0ea3bf51276b8e4dfe4 (diff) |
- test fixes
Diffstat (limited to 'service/container_test.go')
-rw-r--r-- | service/container_test.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/service/container_test.go b/service/container_test.go index 4628986a..ad4c1e64 100644 --- a/service/container_test.go +++ b/service/container_test.go @@ -67,7 +67,10 @@ type testCfg struct{ cfg string } func (cfg *testCfg) Get(name string) Config { vars := make(map[string]interface{}) - json.Unmarshal([]byte(cfg.cfg), &vars) + err := json.Unmarshal([]byte(cfg.cfg), &vars) + if err != nil { + panic("error unmarshalling the cfg.cfg value") + } v, ok := vars[name] if !ok { @@ -439,6 +442,10 @@ func TestContainer_InitErrorB(t *testing.T) { type testInitC struct{} +func (r *testInitC) Test() bool { + return true +} + func TestContainer_NoInit(t *testing.T) { logger, _ := test.NewNullLogger() logger.SetLevel(logrus.DebugLevel) @@ -462,7 +469,6 @@ func (c *DCfg) Hydrate(cfg Config) error { if err := cfg.Unmarshal(c); err != nil { return err } - if c.V == "fail" { return errors.New("failed config") } |