MCPcopy
hub / github.com/mkdocs/mkdocs / test_md_file_nested

Method test_md_file_nested

mkdocs/tests/structure/file_tests.py:91–110  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

89 self.assertFalse(f.is_css())
90
91 def test_md_file_nested(self):
92 for use_directory_urls in True, False:
93 with self.subTest(use_directory_urls=use_directory_urls):
94 f = File('foo/bar.md', '/path/to/docs', '/path/to/site', use_directory_urls)
95 self.assertEqual(f.src_uri, 'foo/bar.md')
96 self.assertPathsEqual(f.abs_src_path, '/path/to/docs/foo/bar.md')
97 if use_directory_urls:
98 self.assertEqual(f.dest_uri, 'foo/bar/index.html')
99 self.assertPathsEqual(f.abs_dest_path, '/path/to/site/foo/bar/index.html')
100 self.assertEqual(f.url, 'foo/bar/')
101 else:
102 self.assertEqual(f.dest_uri, 'foo/bar.html')
103 self.assertPathsEqual(f.abs_dest_path, '/path/to/site/foo/bar.html')
104 self.assertEqual(f.url, 'foo/bar.html')
105 self.assertEqual(f.name, 'bar')
106 self.assertTrue(f.is_documentation_page())
107 self.assertFalse(f.is_static_page())
108 self.assertFalse(f.is_media_file())
109 self.assertFalse(f.is_javascript())
110 self.assertFalse(f.is_css())
111
112 def test_md_index_file(self):
113 for use_directory_urls in True, False:

Callers

nothing calls this directly

Calls 7

is_documentation_pageMethod · 0.95
is_static_pageMethod · 0.95
is_media_fileMethod · 0.95
is_javascriptMethod · 0.95
is_cssMethod · 0.95
FileClass · 0.90
assertPathsEqualMethod · 0.80

Tested by

no test coverage detected