Skip to content

Commit

Permalink
- r replace supplier with supplies
Browse files Browse the repository at this point in the history
  • Loading branch information
JayBazuzi committed Mar 3, 2025
1 parent 74c8f6f commit d453350
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions approve_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ def move(a: str, b: str) -> None:


def approve_all(
failed_comparison_loader: Callable[[], list[str]] = load_failed_comparisons,
failed_comparisons: list[str],
mover: Callable[[str, str], None] = move,
) -> None:
for line in failed_comparison_loader():
for line in failed_comparisons:
a, b = line.split(" -> ")
mover(a, b)


if __name__ == "__main__":
approve_all()
approve_all(load_failed_comparisons())
7 changes: 3 additions & 4 deletions test_approve_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ def render_template(root_dir, template_path):


def test__approve_all__with_loader_and_saver():
def failed_comparison_loader():
return [
failed_comparisons = [
"a.received.txt -> a.approved.txt",
"b.received.txt -> b.approved.txt",
]
Expand All @@ -62,6 +61,6 @@ def mover(a, b):
nonlocal moves
moves.append(f"{a} -> {b}")

approve_all(failed_comparison_loader, mover)
approve_all(failed_comparisons, mover)

assert moves == failed_comparison_loader()
assert moves == failed_comparisons

0 comments on commit d453350

Please sign in to comment.