1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-10-13 01:37:02 +08:00

fix http test

This commit is contained in:
verokarhu
2014-09-30 23:16:55 +03:00
parent c6c758d93f
commit f40fbb2462

View File

@ -24,9 +24,9 @@ type test struct {
func TestServeHTTP(t *testing.T) {
testhandler := &handler{&testIpfsHandler{}}
tests := []test{
{"/", http.StatusInternalServerError, "", ""},
{"/hash", http.StatusOK, "", "some fine data"},
{"/hash2", http.StatusInternalServerError, "", ""},
{"/ipfs/", http.StatusInternalServerError, "", ""},
{"/ipfs/hash", http.StatusOK, "", "some fine data"},
{"/ipfs/hash2", http.StatusInternalServerError, "", ""},
}
for _, test := range tests {
@ -48,9 +48,9 @@ func TestServeHTTP(t *testing.T) {
func TestPostHandler(t *testing.T) {
testhandler := &handler{&testIpfsHandler{}}
tests := []test{
{"/", http.StatusInternalServerError, "", ""},
{"/", http.StatusInternalServerError, "something that causes an error in adding to DAG", ""},
{"/", http.StatusCreated, "some fine data", "jSQBpNSebeYbPBjs1vp"},
{"/ifps/", http.StatusInternalServerError, "", ""},
{"/ipfs/", http.StatusInternalServerError, "something that causes an error in adding to DAG", ""},
{"/ipfs/", http.StatusCreated, "some fine data", "jSQBpNSebeYbPBjs1vp"},
}
for _, test := range tests {