diff options
author | Anton Titov <[email protected]> | 2020-02-23 16:49:43 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-23 16:49:43 +0300 |
commit | b0a4a0dd0b968ba4d5ef20b660621a3d48efc8bf (patch) | |
tree | f80a4d4cf8d7725491aa8aa3939fdbd4d17c13e3 /service/gzip/service_test.go | |
parent | 0bc60171f9bf6800114fc0fcf931b1831fbd11f1 (diff) | |
parent | 954fa52704af5e9d7745de759743e16b3b7b563c (diff) |
Merge pull request #252 from spiral/rr_1.6.2
release 1.6.2
Diffstat (limited to 'service/gzip/service_test.go')
-rw-r--r-- | service/gzip/service_test.go | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/service/gzip/service_test.go b/service/gzip/service_test.go index 9801860f..858dbe56 100644 --- a/service/gzip/service_test.go +++ b/service/gzip/service_test.go @@ -31,24 +31,6 @@ func (cfg *testCfg) Unmarshal(out interface{}) error { return json.Unmarshal([]byte(cfg.target), out) } -//func get(url string) (string, *http.Response, error) { -// r, err := http.Get(url) -// if err != nil { -// return "", nil, err -// } -// -// b, err := ioutil.ReadAll(r.Body) -// if err != nil { -// return "", nil, err -// } -// -// err = r.Body.Close() -// if err != nil { -// return "", nil, err -// } -// -// return string(b), r, err -//} func Test_Disabled(t *testing.T) { logger, _ := test.NewNullLogger() @@ -65,56 +47,3 @@ func Test_Disabled(t *testing.T) { assert.NotNil(t, s) assert.Equal(t, service.StatusInactive, st) } - -// func Test_Files(t *testing.T) { -// logger, _ := test.NewNullLogger() -// logger.SetLevel(logrus.DebugLevel) - -// c := service.NewContainer(logger) -// c.Register(rrhttp.ID, &rrhttp.Service{}) -// c.Register(ID, &Service{}) - -// assert.NoError(t, c.Init(&testCfg{ -// gzip: `{"enable":true}`, -// static: `{"enable":true, "dir":"../../tests", "forbid":[]}`, -// httpCfg: `{ -// "enable": true, -// "address": ":6029", -// "maxRequestSize": 1024, -// "uploads": { -// "dir": ` + tmpDir() + `, -// "forbid": [] -// }, -// "workers":{ -// "command": "php ../../tests/http/client.php pid pipes", -// "relay": "pipes", -// "pool": { -// "numWorkers": 1, -// "allocateTimeout": 10000000, -// "destroyTimeout": 10000000 -// } -// } -// }`})) - -// go func() { -// err := c.Serve() -// if err != nil { -// t.Errorf("serve error: %v", err) -// } -// }() -// time.Sleep(time.Millisecond * 1000) -// defer c.Stop() - -// b, _, _ := get("http://localhost:6029/sample.txt") -// assert.Equal(t, "sample", b) -// //header should not contain content-encoding:gzip because content-length < gziphandler.DefaultMinSize -// // b, _, _ := get("http://localhost:6029/gzip-large-file.txt") -// //header should contain content-encoding:gzip because content-length > gziphandler.DefaultMinSize -// } - -//func tmpDir() string { -// p := os.TempDir() -// r, _ := json.Marshal(p) -// -// return string(r) -//} |