提交 f40fbb24 作者: verokarhu

fix http test

上级 c6c758d9
......@@ -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 {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论