Skip to content
Draft
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
32 changes: 32 additions & 0 deletions crates/cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,22 @@ mod tests {
}
}

#[test]
fn cli_accepts_bucket_list_alias() {
let cli =
Cli::try_parse_from(["rc", "bucket", "ls", "local/"]).expect("parse bucket ls alias");

match cli.command {
Commands::Bucket(args) => match args.command {
bucket::BucketCommands::List(arg) => {
assert_eq!(arg.path, "local/");
}
other => panic!("expected bucket list alias, got {:?}", other),
},
other => panic!("expected bucket command, got {:?}", other),
}
}

#[test]
fn cli_accepts_top_level_cors_subcommand() {
let cli = Cli::try_parse_from(["rc", "cors", "remove", "local/my-bucket"])
Expand All @@ -439,6 +455,22 @@ mod tests {
}
}

#[test]
fn cli_accepts_object_list_alias() {
let cli = Cli::try_parse_from(["rc", "object", "ls", "local/my-bucket/logs/"])
.expect("parse object ls alias");

match cli.command {
Commands::Object(args) => match args.command {
object::ObjectCommands::List(arg) => {
assert_eq!(arg.path, "local/my-bucket/logs/");
}
other => panic!("expected object list alias, got {:?}", other),
},
other => panic!("expected object command, got {:?}", other),
}
}

#[test]
fn cli_accepts_bucket_cors_get_alias() {
let cli = Cli::try_parse_from(["rc", "bucket", "cors", "get", "local/my-bucket"])
Expand Down
Loading