summaryrefslogtreecommitdiffstats
path: root/tests/page_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/page_test.py')
-rw-r--r--tests/page_test.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/page_test.py b/tests/page_test.py
new file mode 100644
index 0000000..c68e435
--- /dev/null
+++ b/tests/page_test.py
@@ -0,0 +1,19 @@
+from g2h.page import Page
+from jinja2.exceptions import TemplateNotFound
+import pytest
+
+def test_init():
+ page = Page('overview.md', 'dir', 'file', 'name', 'sub/dir')
+ assert(page.name == 'name')
+ assert(page.out_file_path == 'dir/file')
+ assert(page.template.name == 'overview.md')
+ assert(page.content_subdir == 'sub/dir')
+
+def test_wrong_template():
+ with pytest.raises(TemplateNotFound):
+ Page('not existant.md', 'dir', 'file', 'name', '')
+
+def test_no_context():
+ page = Page('overview.md', 'dir', 'file', 'name', '')
+ with pytest.raises(NotImplementedError):
+ page.context()