def test_list_in_equation(self): try: res = change_list_format("toto.md", "l1\n$$\n- ttt\n - aaa\n$$\nl3\n") assert res == "l1\n$$\n- ttt\n - aaa\n$$\nl3\n" except Exception as e: assert str(e) == ''
def test_list_inner_1(self): try: res = change_list_format( "toto.md", "l1\n- ttt\n\n- aaa\n - bbb\n- ccc\nl3\n") assert res == "l1\n\n- ttt\n\n- aaa\n\n - bbb\n\n- ccc\nl3\n" except Exception as e: assert str(e) == ''
def test_list_stars(self): try: res = change_list_format( "toto.md", "`cookbook` will store 3 recipes:\n* sandwich\n* cake\n* salad\n" ) assert res == "`cookbook` will store 3 recipes:\n\n* sandwich\n\n* cake\n\n* salad\n" except Exception as e: assert str(e) == ''
def test_list_inner_1_wrong_factor(self): try: res = change_list_format( "toto.md", "l1\n- ttt\n\n- aaa\n - bbb\n- ccc\nl3\n") assert res == "" except Exception as e: assert str( e ) == '[Error] toto.md:5 :: number of spaces in front of list is not a factor of 4 !'
def test_list_2_dots(self): try: res = change_list_format("toto.md", "l1:\n* ttt\n\n* aaa\nl3\n") assert res == "l1:\n\n* ttt\n\n* aaa\nl3\n" except Exception as e: assert str(e) == ''
def test_empty_file(self): try: res = change_list_format("toto.md", "") assert res == "" except Exception as e: assert str(e) == '[Error] toto.md :: empty file !'