summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-13 22:13:35 +0300
committerWolfy-J <[email protected]>2018-06-13 22:13:35 +0300
commit235adef3eef67888e4c391b28cedadfb3f8874e3 (patch)
tree97a4bb9f964580df086ee720d9fe848a7670cc67
parent376547add61b3900711d33f6a20f395f7d1f4aea (diff)
more tests
-rw-r--r--service/http/service_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/service/http/service_test.go b/service/http/service_test.go
index 27d05783..773bcb24 100644
--- a/service/http/service_test.go
+++ b/service/http/service_test.go
@@ -356,6 +356,33 @@ func Test_Service_Error3(t *testing.T) {
}`}))
}
+func Test_Service_Error4(t *testing.T) {
+ logger, _ := test.NewNullLogger()
+ logger.SetLevel(logrus.DebugLevel)
+
+ c := service.NewContainer(logger)
+ c.Register(Name, &Service{})
+
+ assert.Error(t, c.Init(&testCfg{`{
+ "enable": true,
+ "address": "----",
+ "maxRequest": 1024,
+ "uploads": {
+ "dir": ` + tmpDir() + `,
+ "forbid": []
+ },
+ "workers":{
+ "command": "php ../../php-src/tests/http/client.php broken pipes",
+ "relay": "pipes",
+ "pool": {
+ "numWorkers": 1,
+ "allocateTimeout": 10000000,
+ "destroyTimeout": 10000000
+ }
+ }
+ }`}))
+}
+
func tmpDir() string {
p := os.TempDir()
r, _ := json.Marshal(p)