From 8256e3a7c68977d8363419bf51d160fc8768e8c4 Mon Sep 17 00:00:00 2001 From: wen Date: Mon, 29 Jul 2024 18:11:33 +0800 Subject: [PATCH] remove temp --- tests/tests.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/tests.go b/tests/tests.go index 078018d..d2899f6 100644 --- a/tests/tests.go +++ b/tests/tests.go @@ -18,7 +18,6 @@ func TestAll(storage oss.StorageInterface, t *testing.T) { fmt.Printf("testing file in %v\n", filepath.Join(storage.GetEndpoint(), randomPath)) fileName := "/" + filepath.Join(randomPath, "sample.txt") - sampleFileName, _ := storage.GetURL("/tmp" + fileName) fileName2 := "/" + filepath.Join(randomPath, "sample2", "sample.txt") exceptObjects := 2 sampleFile, _ := filepath.Abs("../tests/sample.txt") @@ -35,16 +34,11 @@ func TestAll(storage oss.StorageInterface, t *testing.T) { } // Put file again - if file, err := os.Open(sampleFileName); err == nil { + if file, err := storage.GetStream(fileName); err == nil { if object, err := storage.Put(fileName, file); err != nil { t.Errorf("No error should happen when save sample file, but got %v", err) } else if object.Path == "" || object.StorageInterface == nil { t.Errorf("returned object should necessary information") - } else { - stat, _ := os.Stat(sampleFileName) - if stat.Size() == 0 { - t.Errorf("put same file error") - } } } else { t.Errorf("No error should happen when opem sample file, but got %v", err)