comparison tests/test_sources_base.py @ 36:485682a6de50

New site layout support.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 20 Aug 2014 23:16:51 -0700
parents 4bd840ae75cd
children b536022078a2
comparison
equal deleted inserted replaced
35:e4c345dcf33c 36:485682a6de50
27 'test': {}}, 27 'test': {}},
28 'routes': [ 28 'routes': [
29 {'url': '/%path%', 'source': 'test'}] 29 {'url': '/%path%', 'source': 'test'}]
30 } 30 }
31 }) 31 })
32 fs.withDir('kitchen/_content/test') 32 fs.withDir('kitchen/test')
33 with mock_fs_scope(fs): 33 with mock_fs_scope(fs):
34 app = PieCrust(fs.path('kitchen'), cache=False) 34 app = PieCrust(fs.path('kitchen'), cache=False)
35 s = app.getSource('test') 35 s = app.getSource('test')
36 facs = list(s.buildPageFactories()) 36 facs = list(s.buildPageFactories())
37 paths = [f.rel_path for f in facs] 37 paths = [f.rel_path for f in facs]
40 assert slugs == expected_slugs 40 assert slugs == expected_slugs
41 41
42 42
43 43
44 @pytest.mark.parametrize('ref_path, expected', [ 44 @pytest.mark.parametrize('ref_path, expected', [
45 ('foo.html', '/kitchen/_content/test/foo.html'), 45 ('foo.html', '/kitchen/test/foo.html'),
46 ('foo/bar.html', '/kitchen/_content/test/foo/bar.html'), 46 ('foo/bar.html', '/kitchen/test/foo/bar.html'),
47 ]) 47 ])
48 def test_default_source_resolve_ref(ref_path, expected): 48 def test_default_source_resolve_ref(ref_path, expected):
49 fs = mock_fs() 49 fs = mock_fs()
50 fs.withConfig({ 50 fs.withConfig({
51 'site': { 51 'site': {