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) == ''
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 !'
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) == ''
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 !'