From 8295474f38d17c14be32700271e4a95eccd4f52f Mon Sep 17 00:00:00 2001 From: zelig Date: Wed, 3 Jun 2015 00:06:01 +0100 Subject: [PATCH] fix TestApiFileUpload and added TestApiFileUploadWithRootFile --- bzz/api_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bzz/api_test.go b/bzz/api_test.go index 7eea9abb51..a7bca204f1 100644 --- a/bzz/api_test.go +++ b/bzz/api_test.go @@ -122,6 +122,22 @@ func TestApiFileUpload(t *testing.T) { 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")) testGet(t, api, bzzhash, content, "text/html", 0, 202) }