From bddab751c0cd3c19f650a1e9ce3b9d03e71f70fe Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Sun, 23 Sep 2018 15:06:48 +0300 Subject: default configs --- service/http/service_test.go | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'service/http/service_test.go') diff --git a/service/http/service_test.go b/service/http/service_test.go index 03a2b9a5..d1d601dc 100644 --- a/service/http/service_test.go +++ b/service/http/service_test.go @@ -25,6 +25,10 @@ type testCfg struct { func (cfg *testCfg) Get(name string) service.Config { if name == ID { + if cfg.httpCfg == "" { + return nil + } + return &testCfg{target: cfg.httpCfg} } @@ -63,24 +67,7 @@ func Test_Service_Configure_Disable(t *testing.T) { c := service.NewContainer(logger) c.Register(ID, &Service{}) - assert.NoError(t, c.Init(&testCfg{httpCfg: `{ - "enable": false, - "address": ":8070", - "maxRequest": 1024, - "uploads": { - "dir": ` + tmpDir() + `, - "forbid": [] - }, - "workers":{ - "command": "php ../../tests/http/client.php echo pipes", - "relay": "pipes", - "pool": { - "numWorkers": 1, - "allocateTimeout": 10000000, - "destroyTimeout": 10000000 - } - } - }`})) + assert.NoError(t, c.Init(&testCfg{})) s, st := c.Get(ID) assert.NotNil(t, s) -- cgit v1.2.3