Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Javex committed Feb 23, 2024
1 parent 2b2760e commit 1caf697
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/test_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_merge_price_history():
# Price changed
old_items = [get_item()]
new_items = [get_item(price=2)]
items = analysis.merge_price_history(old_items, new_items)
items = analysis.merge_price_history(old_items, new_items, store_filter=None)
assert len(items) == 1
item = items[0]
assert item['price'] == 2
Expand All @@ -26,7 +26,7 @@ def test_merge_price_history():
# Price didn't change
old_items = [get_item()]
new_items = [get_item()]
items = analysis.merge_price_history(old_items, new_items)
items = analysis.merge_price_history(old_items, new_items, store_filter=None)
assert len(items) == 1
item = items[0]
assert item['price'] == 1
Expand All @@ -35,7 +35,7 @@ def test_merge_price_history():

# No past history
new_items = [get_item(price=2)]
items = analysis.merge_price_history(None, new_items)
items = analysis.merge_price_history(None, new_items, store_filter=None)
assert len(items) == 1
item = items[0]
assert item['price'] == 2
Expand All @@ -45,7 +45,7 @@ def test_merge_price_history():
# Multiple products
old_items = [get_item(price=3), get_item(id='2')]
new_items = [get_item(price=2), get_item(id='2')]
items = analysis.merge_price_history(old_items, new_items)
items = analysis.merge_price_history(old_items, new_items, store_filter=None)
assert len(items) == 2
item = items[0]
assert item['price'] == 2
Expand All @@ -56,7 +56,7 @@ def test_merge_price_history():
# Repeat run of history on same day
old_items = [get_item()]
new_items = [old_items[0]]
items = analysis.merge_price_history(old_items, new_items)
items = analysis.merge_price_history(old_items, new_items, store_filter=None)
assert len(items) == 1
item = items[0]
assert len(item['priceHistory']) == 1
Expand All @@ -65,8 +65,8 @@ def test_merge_price_history():
oldest_items = [get_item()]
middle_items = [get_item(price=2)]
newest_items = [get_item(price=2)]
items = analysis.merge_price_history(oldest_items, middle_items)
items = analysis.merge_price_history(items, newest_items)
items = analysis.merge_price_history(oldest_items, middle_items, store_filter=None)
items = analysis.merge_price_history(items, newest_items, store_filter=None)
assert len(items) == 1
item = items[0]
assert len(item['priceHistory']) == 2

0 comments on commit 1caf697

Please sign in to comment.