fix TestApiFileUpload and added TestApiFileUploadWithRootFile

This commit is contained in:
zelig 2015-06-03 00:06:01 +01:00
parent cd002ffa11
commit 8295474f38

View file

@ -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)
} }