def test_that_multiple_paragraphs_are_recognized(self):
     lines = 'Ich\nbin\n\nein\nTest'
     result = mp.file2paragraphs(lines.split('\n'))
     self.assertEqual(result[1], ['Ich', 'bin'])
     self.assertEqual(result[4], ['ein','Test'])
 def test_that_lines_are_joined_and_line_numbers_are_correct(self):
     content = '##bad\\\nexample\n\ndone'
     result = mp.file2paragraphs(content, join_lines=True)
     # paragraph after joined line starts with correct line number
     self.assertTrue(4 in result)
     self.assertFalse('\\' in '\n'.join(result[1]))
 def test_that_a_simple_paragraph_is_recognized(self):
     pars = mp.file2paragraphs(['Hallo Welt'])
     self.assertEqual(len(pars), 1)
     self.assertEqual(pars[1], ['Hallo Welt'])
 def test_that_a_multiline_paragraph_is_recognized_correctly(self):
     expected = ['Hallo','Welt']
     actual = mp.file2paragraphs('\n'.join(expected))
     self.assertEqual(actual[1], expected)
 def get_res(string):
     pars = mp.file2paragraphs([string])
     heading = mp.extract_headings_from_par(pars)[0]
     return heading.is_numbered()
def par(string):
    """Transform a string (with paragraphs into a paragraph dictionary."""
    return mp.file2paragraphs(string.split('\n'))
def parcdblk(string):
    """Get a paragraph dictionary with code block already removed."""
    return mp.rm_codeblocks(
            mp.file2paragraphs(string.split('\n')))
 def test_that_multiple_paragraphs_are_recognized(self):
     lines = "Ich\nbin\n\nein\nTest"
     result = mp.file2paragraphs(lines.split("\n"))
     self.assertEqual(result[1], ["Ich", "bin"])
     self.assertEqual(result[4], ["ein", "Test"])
 def test_that_a_multiline_paragraph_is_recognized_correctly(self):
     expected = ["Hallo", "Welt"]
     actual = mp.file2paragraphs("\n".join(expected))
     self.assertEqual(actual[1], expected)