mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
fix TestApiFileUpload and added TestApiFileUploadWithRootFile
This commit is contained in:
parent
cd002ffa11
commit
8295474f38
1 changed files with 16 additions and 0 deletions
|
|
@ -122,6 +122,22 @@ func TestApiFileUpload(t *testing.T) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
content, err := ioutil.ReadFile(path.Join(testDir, "test0", "index.html"))
|
||||||
|
testGet(t, api, path.Join(bzzhash, "index.html"), content, "text/html", 0, 202)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestApiFileUploadWithRootFile(t *testing.T) {
|
||||||
|
api, err := testApi()
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("unexpected error: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
bzzhash, err := api.Upload(path.Join(testDir, "test0", "index.html"), "index.html")
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("unexpected error: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
content, err := ioutil.ReadFile(path.Join(testDir, "test0", "index.html"))
|
content, err := ioutil.ReadFile(path.Join(testDir, "test0", "index.html"))
|
||||||
testGet(t, api, bzzhash, content, "text/html", 0, 202)
|
testGet(t, api, bzzhash, content, "text/html", 0, 202)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue