summaryrefslogtreecommitdiff
path: root/tests/test_yaml_parser.py
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2023-02-21 21:02:23 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2023-02-21 21:02:23 -0600
commit28c2ae9102d4204b3f0a79419eec1e72dbbc529a (patch)
treee93b4034371bc569f2a528db6cd5ad29afd9b001 /tests/test_yaml_parser.py
parentf2ab2bac6b26f82730d5f5d7ab1e6d5f2f1060e3 (diff)
add configuration testing, small refactor
Diffstat (limited to 'tests/test_yaml_parser.py')
-rw-r--r--tests/test_yaml_parser.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/test_yaml_parser.py b/tests/test_yaml_parser.py
index 9a1b3c3..dd4c6d4 100644
--- a/tests/test_yaml_parser.py
+++ b/tests/test_yaml_parser.py
@@ -1,19 +1,23 @@
-from importlib.resources import path as rpath
+from typing import Any
from pyssg.yaml_parser import get_parsed_yaml
+# the point of these tests is just to read yaml files
+# and test the join functionality
-def test_yaml_resource_read() -> None:
- yaml: list[dict] = get_parsed_yaml('simple.yaml', 'tests.io_files')
+
+def test_yaml_resource_read(simple_yaml:str, test_resource: str) -> None:
+ yaml: list[dict[str, Any]] = get_parsed_yaml(simple_yaml, test_resource)
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')
+ yaml_path: str = f'{test_dir}/io_files/simple.yaml'
+ yaml: list[dict[str, Any]] = get_parsed_yaml(yaml_path)
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/'
+def test_yaml_join(simple_yaml:str, test_resource: str) -> None:
+ yaml: dict[str, Any] = get_parsed_yaml(simple_yaml, test_resource)[0]
+ define_str: str = '$PYSSG_HOME/pyssg/site_example/'
assert yaml['define'] == define_str
assert yaml['path']['src'] == f'{define_str}src'