|
|
|
@ -31,6 +31,40 @@ func TestMinioStorageIterator(t *testing.T) { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestMinioStoragePath(t *testing.T) { |
|
|
|
|
m := &MinioStorage{basePath: ""} |
|
|
|
|
assert.Equal(t, "", m.buildMinioPath("/")) |
|
|
|
|
assert.Equal(t, "", m.buildMinioPath(".")) |
|
|
|
|
assert.Equal(t, "a", m.buildMinioPath("/a")) |
|
|
|
|
assert.Equal(t, "a/b", m.buildMinioPath("/a/b/")) |
|
|
|
|
assert.Equal(t, "", m.buildMinioDirPrefix("")) |
|
|
|
|
assert.Equal(t, "a/", m.buildMinioDirPrefix("/a/")) |
|
|
|
|
|
|
|
|
|
m = &MinioStorage{basePath: "/"} |
|
|
|
|
assert.Equal(t, "", m.buildMinioPath("/")) |
|
|
|
|
assert.Equal(t, "", m.buildMinioPath(".")) |
|
|
|
|
assert.Equal(t, "a", m.buildMinioPath("/a")) |
|
|
|
|
assert.Equal(t, "a/b", m.buildMinioPath("/a/b/")) |
|
|
|
|
assert.Equal(t, "", m.buildMinioDirPrefix("")) |
|
|
|
|
assert.Equal(t, "a/", m.buildMinioDirPrefix("/a/")) |
|
|
|
|
|
|
|
|
|
m = &MinioStorage{basePath: "/base"} |
|
|
|
|
assert.Equal(t, "base", m.buildMinioPath("/")) |
|
|
|
|
assert.Equal(t, "base", m.buildMinioPath(".")) |
|
|
|
|
assert.Equal(t, "base/a", m.buildMinioPath("/a")) |
|
|
|
|
assert.Equal(t, "base/a/b", m.buildMinioPath("/a/b/")) |
|
|
|
|
assert.Equal(t, "base/", m.buildMinioDirPrefix("")) |
|
|
|
|
assert.Equal(t, "base/a/", m.buildMinioDirPrefix("/a/")) |
|
|
|
|
|
|
|
|
|
m = &MinioStorage{basePath: "/base/"} |
|
|
|
|
assert.Equal(t, "base", m.buildMinioPath("/")) |
|
|
|
|
assert.Equal(t, "base", m.buildMinioPath(".")) |
|
|
|
|
assert.Equal(t, "base/a", m.buildMinioPath("/a")) |
|
|
|
|
assert.Equal(t, "base/a/b", m.buildMinioPath("/a/b/")) |
|
|
|
|
assert.Equal(t, "base/", m.buildMinioDirPrefix("")) |
|
|
|
|
assert.Equal(t, "base/a/", m.buildMinioDirPrefix("/a/")) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestS3StorageBadRequest(t *testing.T) { |
|
|
|
|
if os.Getenv("CI") == "" { |
|
|
|
|
t.Skip("S3Storage not present outside of CI") |
|
|
|
|