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