summaryrefslogtreecommitdiff
path: root/service/http/service_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-09-23 15:06:48 +0300
committerWolfy-J <[email protected]>2018-09-23 15:06:48 +0300
commitbddab751c0cd3c19f650a1e9ce3b9d03e71f70fe (patch)
tree815b9c237ff47b3cd8fd9028c94603a486b3c868 /service/http/service_test.go
parent54afbfe59e1863f96c2a68764e0bd1fcfef74ade (diff)
default configs
Diffstat (limited to 'service/http/service_test.go')
-rw-r--r--service/http/service_test.go23
1 files changed, 5 insertions, 18 deletions
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)