File: test_site.py

package info (click to toggle)
mkdocs-macros-plugin 1.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 372 kB
  • sloc: python: 1,336; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 610 bytes parent folder | download
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')