diff options
author | Wolfy-J <[email protected]> | 2018-06-10 18:34:01 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-10 18:34:01 +0300 |
commit | ba99a17a3a7bb88d44fdc6e65001ef0b0dcd6833 (patch) | |
tree | 43358ff57721f22d3ee406472389aa3181c4ab83 | |
parent | 20633959a35a09efd5a8ffdee5f79f825662e735 (diff) |
fixing some tests
-rw-r--r-- | http/uploads_config_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/http/uploads_config_test.go b/http/uploads_config_test.go index e2de97f2..7704a486 100644 --- a/http/uploads_config_test.go +++ b/http/uploads_config_test.go @@ -3,6 +3,7 @@ package http import ( "testing" "github.com/stretchr/testify/assert" + "os" ) func TestFsConfig_Forbids(t *testing.T) { @@ -13,3 +14,11 @@ func TestFsConfig_Forbids(t *testing.T) { assert.True(t, cfg.Forbids("phpadmin/index.bak.php")) assert.False(t, cfg.Forbids("index.html")) } + +func TestFsConfig_TmpFallback(t *testing.T) { + cfg := UploadsConfig{Dir: "test"} + assert.Equal(t, "test", cfg.TmpDir()) + + cfg = UploadsConfig{Dir: ""} + assert.Equal(t, os.TempDir(), cfg.TmpDir()) +} |