コード例 #1
0
ファイル: test_renderer.py プロジェクト: iwillau/addo
    def test_bold_small_paragraphs(self):
        """Test if there is multiple line-breaks, more than 2"""
        paragraph = """
        A sent wrapper fishes across a bog. Inside the shower suffers the confining twin.

        Par2

        When can the constitutional glance the linguistic life? An error participates after the ballot.
        """

        result = prettify_paragraphs(paragraph)
        self.assertEqual(result.count('<p>'), 3)
        self.assertEqual(result.count('</p>'), 3)
        self.assertEqual(result.count('<b>Par2</b>'), 1, msg='Could not find <b> paragraph.')
コード例 #2
0
    def test_bold_small_paragraphs(self):
        """Test if there is multiple line-breaks, more than 2"""
        paragraph = """
        A sent wrapper fishes across a bog. Inside the shower suffers the confining twin.

        Par2

        When can the constitutional glance the linguistic life? An error participates after the ballot.
        """

        result = prettify_paragraphs(paragraph)
        self.assertEqual(result.count('<p>'), 3)
        self.assertEqual(result.count('</p>'), 3)
        self.assertEqual(result.count('<b>Par2</b>'),
                         1,
                         msg='Could not find <b> paragraph.')
コード例 #3
0
ファイル: test_renderer.py プロジェクト: iwillau/addo
 def test_split_into_p(self):
     result = prettify_paragraphs('Par1\n\nPar2\n\nPar3')
     self.assertEqual(result.count('<p>'), 3)
     self.assertEqual(result.count('</p>'), 3)
コード例 #4
0
ファイル: test_renderer.py プロジェクト: iwillau/addo
 def test_split_multiple_joined(self):
     """Test if there is multiple line-breaks, more than 2"""
     result = prettify_paragraphs('Par1\n\nPar2\n\n\n\nPar3')
     self.assertEqual(result.count('<p>'), 3)
     self.assertEqual(result.count('</p>'), 3)
コード例 #5
0
ファイル: test_renderer.py プロジェクト: iwillau/addo
 def test_split_only_double(self):
     result = prettify_paragraphs('Par1\nPar2\n\nPar3')
     self.assertEqual(result.count('<p>'), 2)
     self.assertEqual(result.count('</p>'), 2)
コード例 #6
0
 def test_split_into_p(self):
     result = prettify_paragraphs('Par1\n\nPar2\n\nPar3')
     self.assertEqual(result.count('<p>'), 3)
     self.assertEqual(result.count('</p>'), 3)
コード例 #7
0
 def test_split_multiple_joined(self):
     """Test if there is multiple line-breaks, more than 2"""
     result = prettify_paragraphs('Par1\n\nPar2\n\n\n\nPar3')
     self.assertEqual(result.count('<p>'), 3)
     self.assertEqual(result.count('</p>'), 3)
コード例 #8
0
 def test_split_only_double(self):
     result = prettify_paragraphs('Par1\nPar2\n\nPar3')
     self.assertEqual(result.count('<p>'), 2)
     self.assertEqual(result.count('</p>'), 2)