summaryrefslogtreecommitdiff
path: root/tests/test_yaml_parser.py
blob: 9a1b3c38fa7a2ea56e3a824e5e69bd0952fdff62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from importlib.resources import path as rpath
from pyssg.yaml_parser import get_parsed_yaml


def test_yaml_resource_read() -> None:
    yaml: list[dict] = get_parsed_yaml('simple.yaml', 'tests.io_files')
    assert len(yaml) == 1


def test_yaml_path_read(test_dir: str) -> None:
    yaml: list[dict] = get_parsed_yaml(f'{test_dir}/io_files/simple.yaml')
    assert len(yaml) == 1


def test_yaml_join() -> None:
    yaml: dict = get_parsed_yaml('simple.yaml', 'tests.io_files')[0]
    define_str: str = '$HOME/pyssg/site_example/'
    assert yaml['define'] == define_str
    assert yaml['path']['src'] == f'{define_str}src'