Mercurial > piecrust2
comparison tests/test_sources_base.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 |
---|---|
125 assert r.path == slashfix(fs.path(os.path.join( | 125 assert r.path == slashfix(fs.path(os.path.join( |
126 'kitchen', expected_source_name, expected_rel_path))) | 126 'kitchen', expected_source_name, expected_rel_path))) |
127 | 127 |
128 | 128 |
129 def test_page_ref_with_missing_source(): | 129 def test_page_ref_with_missing_source(): |
130 fs = mock_fs() | 130 fs = mock_fs().withConfig() |
131 with mock_fs_scope(fs): | 131 with mock_fs_scope(fs): |
132 app = fs.getApp() | 132 app = fs.getApp() |
133 r = PageRef(app, 'whatever:doesnt_exist.md') | 133 r = PageRef(app, 'whatever:doesnt_exist.md') |
134 with pytest.raises(Exception): | 134 with pytest.raises(Exception): |
135 r.possible_ref_specs | 135 r.possible_ref_specs |
136 | 136 |
137 | 137 |
138 def test_page_ref_with_missing_file(): | 138 def test_page_ref_with_missing_file(): |
139 fs = mock_fs() | 139 fs = mock_fs().withConfig() |
140 with mock_fs_scope(fs): | 140 with mock_fs_scope(fs): |
141 app = fs.getApp() | 141 app = fs.getApp() |
142 r = PageRef(app, 'pages:doesnt_exist.%ext%') | 142 r = PageRef(app, 'pages:doesnt_exist.%ext%') |
143 assert r.possible_ref_specs == [ | 143 assert r.possible_ref_specs == [ |
144 'pages:doesnt_exist.html', 'pages:doesnt_exist.md', | 144 'pages:doesnt_exist.html', 'pages:doesnt_exist.md', |