示例#1
0
文件: basic.py 项目: lowks/git-toc
 def test_smoke_tests_header_depth(self):
     self.assertEqual(mangle_header("Description", 1),
                      "* [Description](#description)")
     self.assertEqual(mangle_header("Description", 2),
                      "  * [Description](#description)")
     self.assertEqual(mangle_header("Description", 3),
                      "    * [Description](#description)")
     self.assertEqual(mangle_header("Description", 4),
                      "      * [Description](#description)")
示例#2
0
文件: basic.py 项目: lowks/git-toc
 def test_smoke_tests_labels_underscore_char(self):
     self.assertEqual(
         mangle_header("Return result after __exit", 1),
         "* [Return result after __exit](#return-result-after-__exit)")
     self.assertEqual(
         mangle_header("Parsing text received from DUT (line by line)", 1),
         "* [Parsing text received from DUT (line by line)](#parsing-text-received-from-dut-line-by-line)"
     )
     self.assertEqual(mangle_header("Before Greentea v0.2.0", 1),
                      "* [Before Greentea v0.2.0](#before-greentea-v020)")
     self.assertEqual(
         mangle_header("Using __rdx_line event", 1),
         "* [Using __rdx_line event](#using-__rdx_line-event)")
示例#3
0
文件: basic.py 项目: lowks/git-toc
    def test_headers_depth_1(self):
        self.assertEqual(
            mangle_header("Example 2 - digest directly from file", 1),
            "* [Example 2 - digest directly from file](#example-2---digest-directly-from-file)"
        )

        self.assertEqual(
            mangle_header(
                "Example 3 - pipe test.txt file content (as in example 2)", 1),
            "* [Example 3 - pipe test.txt file content (as in example 2)](#example-3---pipe-testtxt-file-content-as-in-example-2)"
        )

        self.assertEqual(
            mangle_header("Switch --use-tids example", 1),
            "* [Switch --use-tids example](#switch---use-tids-example)")
示例#4
0
文件: basic.py 项目: lowks/git-toc
 def test_smoke_tests_labels(self):
     self.assertEqual(mangle_header("", 1), "* [](#)")
     self.assertEqual(mangle_header("a", 1), "* [a](#a)")
     self.assertEqual(mangle_header("A", 1), "* [A](#a)")
     self.assertEqual(mangle_header("Abcde", 1), "* [Abcde](#abcde)")
     self.assertEqual(mangle_header("Switch --version", 1),
                      "* [Switch --version](#switch---version)")
     self.assertEqual(
         mangle_header("Introduction / Examples", 1),
         "* [Introduction / Examples](#introduction--examples)")
     self.assertEqual(
         mangle_header("Revision 3 - duration v0.0.1", 1),
         "* [Revision 3 - duration v0.0.1](#revision-3---duration-v001)")
     self.assertEqual(
         mangle_header("Retrospective in 3 [sec.]", 1),
         "* [Retrospective in 3 [sec.]](#retrospective-in-3-sec)")
示例#5
0
文件: basic.py 项目: lowks/git-toc
 def test_headers_depth_2(self):
     self.assertEqual(
         mangle_header("Environment Pre-Check", 2),
         "  * [Environment Pre-Check](#environment-pre-check)")