diff tests/test_data_linker.py @ 404:27b10024f8d8

linker: Add ability to return the parent and ancestors of a page. Add reference documentation. Add tests.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 24 May 2015 18:15:22 -0700
parents b51ddb0c260b
children e7b865f8f335
line wrap: on
line diff
--- a/tests/test_data_linker.py	Thu May 21 07:33:08 2015 -0700
+++ b/tests/test_data_linker.py	Sun May 24 18:15:22 2015 -0700
@@ -1,3 +1,4 @@
+import os.path
 import pytest
 from piecrust.data.linker import Linker
 from .mockutil import mock_fs, mock_fs_scope
@@ -39,7 +40,8 @@
         app = fs.getApp()
         app.config.set('site/pretty_urls', True)
         src = app.getSource('pages')
-        linker = Linker(src, page_path)
+        linker = Linker(src, os.path.dirname(page_path),
+                        root_page_path=page_path)
         actual = list(iter(linker))
 
         assert len(actual) == len(expected)
@@ -83,7 +85,8 @@
         app = fs.getApp()
         app.config.set('site/pretty_urls', True)
         src = app.getSource('pages')
-        linker = Linker(src, page_path)
+        linker = Linker(src, os.path.dirname(page_path),
+                        root_page_path=page_path)
         actual = list(iter(linker.allpages))
 
         assert len(actual) == len(expected)