/usr/lib/python3/dist-packages/mkdocs/tests/legacy_tests.py is in mkdocs 0.16.3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | from __future__ import unicode_literals
import unittest
from mkdocs import legacy, utils
class TestCompatabilityShim(unittest.TestCase):
# TODO: Remove in 1.0
def test_convert(self):
self.maxDiff = None
pages_yaml_old = """
pages:
- ['index.md', 'Home']
- ['user-guide/writing-your-docs.md', 'User Guide']
- ['user-guide/styling-your-docs.md', 'User Guide']
- ['about/license.md', 'About', 'License']
- ['about/release-notes.md', 'About']
- ['about/contributing.md', 'About', 'Contributing']
- ['help/contributing.md', 'Help', 'Contributing']
- ['support.md']
- ['cli.md', 'CLI Guide']
"""
pages_yaml_new = """
pages:
- Home: index.md
- User Guide:
- user-guide/writing-your-docs.md
- user-guide/styling-your-docs.md
- About:
- License: about/license.md
- about/release-notes.md
- Contributing: about/contributing.md
- Help:
- Contributing: help/contributing.md
- support.md
- CLI Guide: cli.md
"""
self.assertEqual(
legacy.pages_compat_shim(utils.yaml_load(pages_yaml_old)['pages']),
utils.yaml_load(pages_yaml_new)['pages'])
def test_convert_no_home(self):
self.maxDiff = None
pages_yaml_old = """
pages:
- ['index.md']
- ['about.md', 'About']
"""
pages_yaml_new = """
pages:
- index.md
- About: about.md
"""
self.assertEqual(
legacy.pages_compat_shim(utils.yaml_load(pages_yaml_old)['pages']),
utils.yaml_load(pages_yaml_new)['pages'])
|