예제 #1
0
파일: html.py 프로젝트: stephcyrille/cubane
 def test_should_insert_repeatly(self):
     self.assertEqual(
         '<p>Foo Bar</p><p>FooBar</p>!<p>Foo</p>!<p>Foo</p>!<p>Foo</p>!',
         embed_html(
             '<p>Foo Bar</p><p>FooBar</p><p>Foo</p><p>Foo</p><p>Foo</p>',
             '!',
             initial_words=3,
             subsequent_words=1))
예제 #2
0
파일: html.py 프로젝트: stephcyrille/cubane
 def test_should_not_insert_if_inital_budget_has_not_been_reached(self):
     self.assertEqual(
         '<p>Foo</p><p>Bar</p><p>FooBar</p>!<p>Hello World</p>',
         embed_html('<p>Foo</p><p>Bar</p><p>FooBar</p><p>Hello World</p>',
                    '!',
                    initial_words=3))
예제 #3
0
파일: html.py 프로젝트: stephcyrille/cubane
 def test_should_embed_into_text_without_paragraphs(self):
     self.assertEqual('Hello World!', embed_html('Hello World', '!'))
예제 #4
0
파일: html.py 프로젝트: stephcyrille/cubane
 def test_should_embed_into_empty_html(self):
     self.assertEqual('!', embed_html('', '!'))
예제 #5
0
파일: html.py 프로젝트: stephcyrille/cubane
 def test_should_embed_into_none(self):
     self.assertEqual('!', embed_html(None, '!'))
예제 #6
0
파일: html.py 프로젝트: stephcyrille/cubane
 def test_should_insert_after_inital_budget(self):
     self.assertEqual(
         '<p>Foo Bar FooBar</p>!<p>Hello World</p>',
         embed_html('<p>Foo Bar FooBar</p><p>Hello World</p>',
                    '!',
                    initial_words=3))