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