diff options
author | Wolfy-J <[email protected]> | 2019-05-02 17:17:16 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2019-05-02 17:17:16 +0300 |
commit | 7bd5da5327e0d6f602627006d55cf803b8c4a4c7 (patch) | |
tree | 2e76fba4b391e2733a6e59c8149bb22f6c91dfbc /service/http/config_test.go | |
parent | 859441b4d084babca70266bd23ceb2a95269b3ff (diff) |
fixing tests
Diffstat (limited to 'service/http/config_test.go')
-rw-r--r-- | service/http/config_test.go | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/service/http/config_test.go b/service/http/config_test.go index 7c9d629a..4cd2783f 100644 --- a/service/http/config_test.go +++ b/service/http/config_test.go @@ -222,54 +222,3 @@ func Test_Config_InvalidAddress(t *testing.T) { assert.Error(t, cfg.Valid()) } - -func Test_Config_MergeBackwardCompatibility_MaxRequestSize(t *testing.T) { - c := newTestBackwardCompatibilityConfig() - cfg := mockCfg{cfg: `{"maxRequestSize":512}`} - assert.NoError(t, c.Valid()) - assert.NoError(t, c.Hydrate(&cfg)) - assert.Equal(t, int64(512), int64(c.MaxRequestSize)) - - c = newTestBackwardCompatibilityConfig() - cfg = mockCfg{cfg: `{"maxRequestSize":256,"maxRequest":1024}`} - assert.NoError(t, c.Valid()) - assert.NoError(t, c.Hydrate(&cfg)) - assert.Equal(t, int64(256), int64(c.MaxRequestSize)) - - c = newTestBackwardCompatibilityConfig() - cfg = mockCfg{cfg: `{"maxRequestSize":256,"maxRequest":0}`} - assert.NoError(t, c.Valid()) - assert.NoError(t, c.Hydrate(&cfg)) - assert.Equal(t, int64(256), int64(c.MaxRequestSize)) - - c = newTestBackwardCompatibilityConfig() - cfg = mockCfg{cfg: `{"maxRequest":1024}`} - assert.NoError(t, c.Valid()) - assert.NoError(t, c.Hydrate(&cfg)) - assert.Equal(t, int64(1024), int64(c.MaxRequestSize)) - - c = newTestBackwardCompatibilityConfig() - cfg = mockCfg{cfg: `{"maxRequestSize":0,"maxRequest":1024}`} - assert.NoError(t, c.Valid()) - assert.NoError(t, c.Hydrate(&cfg)) - assert.Equal(t, int64(1024), int64(c.MaxRequestSize)) -} - -func newTestBackwardCompatibilityConfig() *Config { - return &Config{ - Address: ":8080", - Uploads: &UploadsConfig{ - Dir: os.TempDir(), - Forbid: []string{".go"}, - }, - Workers: &roadrunner.ServerConfig{ - Command: "php tests/client.php echo pipes", - Relay: "pipes", - Pool: &roadrunner.Config{ - NumWorkers: 1, - AllocateTimeout: time.Second, - DestroyTimeout: time.Second, - }, - }, - } -} |