swarm/api: fixed 404 handling on missing default entry (#15139)

This commit is contained in:
holisticode
2017-10-06 08:45:54 -05:00
committed by Felix Lange
parent d54e3539d4
commit 1ae0411d41
6 changed files with 311 additions and 39 deletions

View File

@ -17,7 +17,6 @@
package api
import (
// "encoding/json"
"bytes"
"encoding/json"
"fmt"
@ -72,11 +71,21 @@ func TestGetEntry(t *testing.T) {
testGetEntry(t, "/a", "", "")
testGetEntry(t, "/a/b", "a/b", "a/b")
// longest/deepest math
testGetEntry(t, "a/b", "-", "a", "a/ba", "a/b/c")
testGetEntry(t, "read", "read", "readme.md", "readit.md")
testGetEntry(t, "rf", "-", "readme.md", "readit.md")
testGetEntry(t, "readme", "readme", "readme.md")
testGetEntry(t, "readme", "-", "readit.md")
testGetEntry(t, "readme.md", "readme.md", "readme.md")
testGetEntry(t, "readme.md", "-", "readit.md")
testGetEntry(t, "readmeAmd", "-", "readit.md")
testGetEntry(t, "readme.mdffff", "-", "readme.md")
testGetEntry(t, "ab", "ab", "ab/cefg", "ab/cedh", "ab/kkkkkk")
testGetEntry(t, "ab/ce", "ab/ce", "ab/cefg", "ab/cedh", "ab/ceuuuuuuuuuu")
testGetEntry(t, "abc", "abc", "abcd", "abczzzzef", "abc/def", "abc/e/g")
testGetEntry(t, "a/b", "a/b", "a", "a/bc", "a/ba", "a/b/c")
testGetEntry(t, "a/b", "a/b", "a", "a/b", "a/bb", "a/b/c")
testGetEntry(t, "//a//b//", "a/b", "a", "a/b", "a/bb", "a/b/c")
}
func TestDeleteEntry(t *testing.T) {
}