Skip to content

Commit

Permalink
Add test cases for the CLI help menu (#4904)
Browse files Browse the repository at this point in the history
No changes in behavior here, adding these test cases to demonstrate
changes to come.
  • Loading branch information
zanieb authored Jul 9, 2024
1 parent 72982c1 commit b4a7d96
Show file tree
Hide file tree
Showing 2 changed files with 824 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/uv/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,13 @@ impl TestContext {
}
}

/// Create a `uv` command for testing.
pub fn command(&self) -> Command {
let mut command = Command::new(get_bin());
self.add_shared_args(&mut command);
command
}

/// Shared behaviour for almost all test commands.
///
/// * Use a temporary cache directory
Expand Down Expand Up @@ -359,6 +366,14 @@ impl TestContext {
command
}

/// Create a `uv help` command with options shared across scenarios.
#[allow(clippy::unused_self)]
pub fn help(&self) -> Command {
let mut command = Command::new(get_bin());
command.arg("help");
command
}

/// Create a `uv sync` command with options shared across scenarios.
pub fn sync(&self) -> Command {
let mut command = Command::new(get_bin());
Expand Down
Loading

0 comments on commit b4a7d96

Please sign in to comment.