Ejemplo n.º 1
0
 def test_empty_block(self):
     try:
         res = change_empty_code_block_style("toto.md",
                                             "dd\n```\ndd\n```\ndd\n")
         assert res == "dd\n```txt\ndd\n```\ndd\n"
     except Exception as e:
         assert str(e) == ''
Ejemplo n.º 2
0
 def test_multiple_code_blocks(self):
     try:
         res = change_empty_code_block_style(
             "toto.md",
             "dd\n```\ndd\n```\ndd\n```python\ndd\n```\ndd\n```\ndd\n```\ndd\n"
         )
         assert res == "dd\n```txt\ndd\n```\ndd\n```python\ndd\n```\ndd\n```txt\ndd\n```\ndd\n"
     except Exception as e:
         assert str(e) == '[Error] toto.md :: empty file !'
Ejemplo n.º 3
0
 def test_wrong_block_number(self):
     try:
         res = change_empty_code_block_style(
             "toto.md", "dd\n```\ndd\n```\ndd\n```\ndd\n")
         assert res == ""
     except Exception as e:
         assert str(
             e
         ) == '[Error] toto.md:6 :: could not find closing code snippet !'
Ejemplo n.º 4
0
 def test_empty_file(self):
     try:
         res = change_empty_code_block_style("toto.md", "")
         assert res == ""
     except Exception as e:
         assert str(e) == '[Error] toto.md :: empty file !'