diff options
Diffstat (limited to 'plugins/static/config_test.go')
-rw-r--r-- | plugins/static/config_test.go | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/plugins/static/config_test.go b/plugins/static/config_test.go deleted file mode 100644 index de88ded3..00000000 --- a/plugins/static/config_test.go +++ /dev/null @@ -1,48 +0,0 @@ -package static - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestConfig_Forbids(t *testing.T) { - cfg := Config{Static: struct { - Dir string - Forbid []string - Always []string - Request map[string]string - Response map[string]string - }{Dir: "", Forbid: []string{".php"}, Always: nil, Request: nil, Response: nil}} - - assert.True(t, cfg.AlwaysForbid("index.php")) - assert.True(t, cfg.AlwaysForbid("index.PHP")) - assert.True(t, cfg.AlwaysForbid("phpadmin/index.bak.php")) - assert.False(t, cfg.AlwaysForbid("index.html")) -} - -func TestConfig_Valid(t *testing.T) { - assert.NoError(t, (&Config{Static: struct { - Dir string - Forbid []string - Always []string - Request map[string]string - Response map[string]string - }{Dir: "./"}}).Valid()) - - assert.Error(t, (&Config{Static: struct { - Dir string - Forbid []string - Always []string - Request map[string]string - Response map[string]string - }{Dir: "./config.go"}}).Valid()) - - assert.Error(t, (&Config{Static: struct { - Dir string - Forbid []string - Always []string - Request map[string]string - Response map[string]string - }{Dir: "./dir/"}}).Valid()) -} |