1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
"""
Testing the project
(C) Laurent Franceschetti 2025
"""
import pytest
from test.fixture import MacrosDocProject
CURRENT_PROJECT = '.'
def test_new_syntax():
project = MacrosDocProject(CURRENT_PROJECT)
project.build()
# did not fail
assert not project.build_result.returncode
page = project.get_page('index')
price = page.meta.unit_price
print("Price found in the meta of the page:", price)
assert page.find_text(f'{price} EUR')
if price > 10:
assert page.find_text('this is expensive')
else:
assert page.find_text('this is cheap')
|