-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
18 lines (13 loc) · 715 Bytes
/
tests.py
File metadata and controls
18 lines (13 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from unittest import TestCase
from src.fetch_utils import fetch_product_page_with_given_href
from src.soup_prices import extract_metadata_for_all_prices, extract_price_items
class TestSoupUtilsMethods(TestCase):
@staticmethod
def test_price_of_unreleased_product() -> None:
# This tests what happens when prices are marked as "Unavailable".
# Reference: https://gg.deals/game/in-the-valley-of-gods/
href = "/game/in-the-valley-of-gods/"
page_soup = fetch_product_page_with_given_href(product_href=href)
price_items = extract_price_items(page_soup=page_soup)
metadata = extract_metadata_for_all_prices(price_items=price_items)
assert not metadata