Skip to content

Commit

Permalink
better pipeline test
Browse files Browse the repository at this point in the history
  • Loading branch information
sbusso committed Mar 24, 2024
1 parent 6e6afcb commit 1c79527
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ def test_process_items_with_json_file_backend():

context = Context(
logger=logging.getLogger(),
filename="example.json",
filename="output.json",
)

pipeline.process_items(items, context)

with open(filename, "r") as f:
data = json.load(f)

assert data == items
with patch("builtins.open") as mock_open:
pipeline.process_items(items, context)
assert mock_open.call_count == 1
assert mock_open.call_args_list[0][0][0] == filename

0 comments on commit 1c79527

Please sign in to comment.