mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-10 22:08:48 +01:00
shell: return flag parse errors from s3.bucket.create (#12544)
This commit is contained in:
1 parent
5863e32318
commit
017e42633f
2 files changed
+12
-1
No files matched your search
@@ -62,6 +62,17 @@ func TestS3BucketCreateRequestsExclusiveCreate(t *testing.T) {
|
||||
assert.Equal(t, "my-bucket", req.Entry.Name)
|
||||
}
|
||||
|
||||
func TestS3BucketCreateReturnsFlagParseError(t *testing.T) {
|
||||
filerServer := &bucketCreateTestFilerServer{}
|
||||
commandEnv, cleanup := newBucketCreateTestCommandEnv(t, filerServer)
|
||||
defer cleanup()
|
||||
|
||||
var output bytes.Buffer
|
||||
err := (&commandS3BucketCreate{}).Do([]string{"-name", "my-bucket", "-withlock"}, commandEnv, &output)
|
||||
require.EqualError(t, err, "flag provided but not defined: -withlock")
|
||||
assert.Empty(t, filerServer.createRequests())
|
||||
}
|
||||
|
||||
func newBucketCreateTestCommandEnv(t *testing.T, filerServer filer_pb.SeaweedFilerServer) (*CommandEnv, func()) {
|
||||
t.Helper()
|
||||
|
||||
|
||||
Reference in new issue
Block a user