Skip to content

Commit

Permalink
Use a consistent pattern for uv add and uv remove tests (#6978)
Browse files Browse the repository at this point in the history
Noticed during #6976 — I'd rather we just used a consistent pattern
here.

Looks like this was added in 2b68a3d
  • Loading branch information
zanieb authored Sep 3, 2024
1 parent 8403a6d commit 71d9ecd
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 98 deletions.
24 changes: 4 additions & 20 deletions crates/uv/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,33 +645,17 @@ impl TestContext {
}

/// Create a `uv add` command for the given requirements.
pub fn add(&self, reqs: &[&str]) -> Command {
pub fn add(&self) -> Command {
let mut command = Command::new(get_bin());
command.arg("add").args(reqs);
self.add_shared_args(&mut command, false);
command
}

/// Create a `uv add --no-sync` command for the given requirements.
pub fn add_no_sync(&self, reqs: &[&str]) -> Command {
let mut command = Command::new(get_bin());
command.arg("add").arg("--no-sync").args(reqs);
command.arg("add");
self.add_shared_args(&mut command, false);
command
}

/// Create a `uv remove` command for the given requirements.
pub fn remove(&self, reqs: &[&str]) -> Command {
let mut command = Command::new(get_bin());
command.arg("remove").args(reqs);
self.add_shared_args(&mut command, false);
command
}

/// Create a `uv remove --no-sync` command for the given requirements.
pub fn remove_no_sync(&self, reqs: &[&str]) -> Command {
pub fn remove(&self) -> Command {
let mut command = Command::new(get_bin());
command.arg("remove").arg("--no-sync").args(reqs);
command.arg("remove");
self.add_shared_args(&mut command, false);
command
}
Expand Down
Loading

0 comments on commit 71d9ecd

Please sign in to comment.