MCPcopy Index your code
hub / github.com/mkdocs/mkdocs / test_context_extra_css_path_warning

Method test_context_extra_css_path_warning

mkdocs/tests/build_tests.py:189–208  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

187 # TODO: This shouldn't pass on Linux
188 # @unittest.skipUnless(sys.platform.startswith("win"), "requires Windows")
189 def test_context_extra_css_path_warning(self):
190 nav_cfg = [
191 {'Home': 'index.md'},
192 ]
193 cfg = load_config(
194 nav=nav_cfg,
195 extra_css=['assets\\style.css'],
196 use_directory_urls=False,
197 )
198 fs = [File('index.md', cfg.docs_dir, cfg.site_dir, cfg.use_directory_urls)]
199 files = Files(fs)
200 nav = get_navigation(files, cfg)
201 with self.assertLogs('mkdocs') as cm:
202 context = build.get_context(nav, files, cfg, nav.pages[0])
203 self.assertEqual(context['extra_css'], ['assets/style.css'])
204 self.assertEqual(
205 '\n'.join(cm.output),
206 "WARNING:mkdocs.utils:Path 'assets\\style.css' uses OS-specific separator '\\'. "
207 "That will be unsupported in a future release. Please change it to '/'.",
208 )
209
210 def test_context_extra_css_js_no_page(self):
211 cfg = load_config(extra_css=['style.css'], extra_javascript=['script.js'])

Callers

nothing calls this directly

Calls 4

load_configFunction · 0.90
FileClass · 0.90
FilesClass · 0.90
get_navigationFunction · 0.90

Tested by

no test coverage detected