Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change some test path to relative path #170

Open
wants to merge 1 commit into
base: dev-2210
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions oss/bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ func (s *OssBucketSuite) TestPutObjectNegative(c *C) {
err = s.bucket.PutObjectFromFile(objectName, "bucket.go", IfModifiedSince(pastDate))
c.Assert(err, NotNil)

err = s.bucket.PutObjectFromFile(objectName, "/tmp/xxx")
err = s.bucket.PutObjectFromFile(objectName, "../tmp/xxx")
c.Assert(err, NotNil)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目录分隔符需要统一修改为 string(os.PathSeparator),以便做到跨平台兼容。


Expand Down Expand Up @@ -907,7 +907,7 @@ func (s *OssBucketSuite) TestGetObjectToWriterNegative(c *C) {
c.Assert(err, IsNil)

// Not exist
err = s.bucket.GetObjectToFile(objectName, "/root/123abc9874")
err = s.bucket.GetObjectToFile(objectName, "../root/123abc9874")
c.Assert(err, NotNil)

// Invalid option
Expand Down
4 changes: 2 additions & 2 deletions oss/download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,10 @@ func (s *OssDownloadSuite) TestDownloadNegative(c *C) {
c.Assert(err, IsNil)

// Local file does not exist
err = s.bucket.DownloadFile(objectName, "/tmp/", 100*1024)
err = s.bucket.DownloadFile(objectName, "../tmp/", 100*1024)
c.Assert(err, NotNil)

err = s.bucket.DownloadFile(objectName, "/tmp/", 100*1024, Routines(2))
err = s.bucket.DownloadFile(objectName, "../tmp/", 100*1024, Routines(2))
c.Assert(err, NotNil)

// Invalid part size
Expand Down
2 changes: 1 addition & 1 deletion oss/multipart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ func (s *OssBucketMultipartSuite) TestDownloadFileNegative(c *C) {
c.Assert(err, NotNil)

// File does not exist
err = s.bucket.DownloadFile(objectName, "/OSS/TEMP/ZIBI/QUQU/BALA", 1024*1024*1024+1)
err = s.bucket.DownloadFile(objectName, "../TEMP/ZIBI/QUQU/BALA", 1024*1024*1024+1)
c.Assert(err, NotNil)

// Key does not exist
Expand Down