예제 #1
0
 def test_comment_in_block(self):
     try:
         res = change_header_format("toto.md",
                                    "\n\n```\n    ## hello\n```\nheader\n")
         assert res == "\n\n```\n    ## hello\n```\nheader\n"
     except Exception as e:
         assert str(e) == ''
예제 #2
0
 def test_header_5_space_front(self):
     try:
         res = change_header_format("toto.md", "     ##### header\n")
         assert res == "     ##### header\n"
     except Exception as e:
         assert str(
             e
         ) == '[Error] toto.md:1 :: too much space(s) in front of header !'
예제 #3
0
 def test_header_4_space_back(_self):
     try:
         res = change_header_format("toto.md", "####    header\n")
         assert res == "#### header\n"
     except Exception as e:
         assert str(e) == ''
예제 #4
0
 def test_empty_file(self):
     try:
         res = change_header_format("toto.md", "")
         assert res == ""
     except Exception as e:
         assert str(e) == '[Error] toto.md :: empty file !'