comparison tests/test_data_linker.py @ 674:f987b29d6fab

tests: Add ability to run tests with a theme site. * Remove automatic creating of `config.yml`. * Add option to specify `theme_config` in YAML tests.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 06 Mar 2016 23:48:01 -0800
parents e7b865f8f335
children 72f17534d58e
comparison
equal deleted inserted replaced
673:d6403c21bdea 674:f987b29d6fab
35 [(False, 'else', True, '/something/else'), 35 [(False, 'else', True, '/something/else'),
36 (False, 'good', False, '/something/good')]) 36 (False, 'good', False, '/something/good')])
37 ]) 37 ])
38 def test_linker_iteration(fs_fac, page_path, expected): 38 def test_linker_iteration(fs_fac, page_path, expected):
39 fs = fs_fac() 39 fs = fs_fac()
40 fs.withConfig()
40 with mock_fs_scope(fs): 41 with mock_fs_scope(fs):
41 app = fs.getApp() 42 app = fs.getApp()
42 app.config.set('site/pretty_urls', True) 43 app.config.set('site/pretty_urls', True)
43 src = app.getSource('pages') 44 src = app.getSource('pages')
44 linker = Linker(src, os.path.dirname(page_path), 45 linker = Linker(src, os.path.dirname(page_path),
81 [('/something/else', True), 82 [('/something/else', True),
82 ('/something/good', False)]) 83 ('/something/good', False)])
83 ]) 84 ])
84 def test_recursive_linker_iteration(fs_fac, page_path, expected): 85 def test_recursive_linker_iteration(fs_fac, page_path, expected):
85 fs = fs_fac() 86 fs = fs_fac()
87 fs.withConfig()
86 with mock_fs_scope(fs): 88 with mock_fs_scope(fs):
87 app = fs.getApp() 89 app = fs.getApp()
88 app.config.set('site/pretty_urls', True) 90 app.config.set('site/pretty_urls', True)
89 src = app.getSource('pages') 91 src = app.getSource('pages')
90 linker = Linker(src, os.path.dirname(page_path), 92 linker = Linker(src, os.path.dirname(page_path),