Ejemplo n.º 1
0
 def test_link_with_description(self):
     line = InlineMarkup("foo [[bar|description & things]]")
     assert line.__html__() == 'foo <a href="bar">description &amp; things</a>'
Ejemplo n.º 2
0
 def test_image_with_alt(self):
     line = InlineMarkup("foo {{bar.png|baz qux}}")
     assert line.__html__() == 'foo <img src="bar.png" alt="baz qux">'
Ejemplo n.º 3
0
 def test_external_link(self):
     line = InlineMarkup("foo [[http://www.example.com/stuff]]")
     assert line.__html__() == 'foo <a href="http://www.example.com/stuff">http://www.example.com/stuff</a>'
Ejemplo n.º 4
0
 def test_code_can_contain_ampersand(self):
     line = InlineMarkup("foo ``bar & baz``")
     assert line.__html__() == "foo <code>bar &amp; baz</code>"
Ejemplo n.º 5
0
 def test_nested_tags_without_explicit_end(self):
     line = InlineMarkup("foo **//bar**")
     assert line.__html__() == "foo <strong><em>bar</em></strong>"
Ejemplo n.º 6
0
 def test_sub(self):
     line = InlineMarkup("foo ,,bar,,")
     assert line.__html__() == "foo <sub>bar</sub>"
Ejemplo n.º 7
0
 def test_oddly_nested_tags(self):
     line = InlineMarkup("foo **//**bar**//**")
     assert line.__html__() == "foo <strong><em></em></strong>bar<strong><em></em></strong>"
Ejemplo n.º 8
0
 def test_auto_link(self):
     line = InlineMarkup("foo http://example.com/ bar")
     assert line.__html__() == 'foo <a href="http://example.com/">http://example.com/</a> bar'
Ejemplo n.º 9
0
 def test_auto_link_with_trailing_dot(self):
     line = InlineMarkup("foo http://example.com/. bar")
     assert line.__html__() == 'foo <a href="http://example.com/">http://example.com/</a>. bar'
Ejemplo n.º 10
0
 def test_escaped_asterisks(self):
     line = InlineMarkup("foo ~** bar")
     assert line.__html__() == "foo ** bar"
Ejemplo n.º 11
0
 def test_trailing_tilde(self):
     line = InlineMarkup("foo bar ~")
     assert line.__html__() == "foo bar ~"
Ejemplo n.º 12
0
 def test_link_with_complex_description(self):
     line = InlineMarkup("[[http://www.example.com/stuff|this is a //really// interesting link --> {{image.jpg}}]]")
     assert line.__html__() == '<a href="http://www.example.com/stuff">this is a <em>really</em> interesting link &rarr; <img src="image.jpg"></a>'
Ejemplo n.º 13
0
 def test_unclosed_link_with_image_description(self):
     line = InlineMarkup("foo [[bar|{{image.jpg")
     assert line.__html__() == 'foo <a href="bar"><img src="image.jpg"></a>'
Ejemplo n.º 14
0
 def test_link_with_description_and_markup(self):
     line = InlineMarkup("foo [[bar|this is an **important** link]]")
     assert line.__html__() == 'foo <a href="bar">this is an <strong>important</strong> link</a>'
Ejemplo n.º 15
0
 def test_code(self):
     line = InlineMarkup("foo ``bar``")
     assert line.__html__() == "foo <code>bar</code>"
Ejemplo n.º 16
0
 def test_no_tags(self):
     line = InlineMarkup("foo bar")
     assert line.__html__() == "foo bar"
Ejemplo n.º 17
0
 def test_sup(self):
     line = InlineMarkup("foo ^^bar^^")
     assert line.__html__() == "foo <sup>bar</sup>"
Ejemplo n.º 18
0
 def test_ampersand(self):
     line = InlineMarkup("foo & bar")
     assert line.__html__() == "foo &amp; bar"
Ejemplo n.º 19
0
 def test_q(self):
     line = InlineMarkup('foo ""bar""')
     assert line.__html__() == "foo <q>bar</q>"
Ejemplo n.º 20
0
 def test_entities(self):
     line = InlineMarkup("foo & ' \" < > bar")
     assert line.__html__() == "foo &amp; &apos; &quot; &lt; &gt; bar"
Ejemplo n.º 21
0
 def test_code_does_not_nest(self):
     line = InlineMarkup("foo ``bar ** baz // qux``")
     assert line.__html__() == "foo <code>bar ** baz // qux</code>"
Ejemplo n.º 22
0
 def test_strong(self):
     line = InlineMarkup("foo **bar**")
     assert line.__html__() == "foo <strong>bar</strong>"
Ejemplo n.º 23
0
 def test_tag_without_explicit_end(self):
     line = InlineMarkup("foo **bar")
     assert line.__html__() == "foo <strong>bar</strong>"
Ejemplo n.º 24
0
 def test_single_asterisks(self):
     line = InlineMarkup("foo *bar*")
     assert line.__html__() == "foo *bar*"
Ejemplo n.º 25
0
 def test_image(self):
     line = InlineMarkup("foo {{bar.png}}")
     assert line.__html__() == 'foo <img src="bar.png">'
Ejemplo n.º 26
0
 def test_em(self):
     line = InlineMarkup("foo //bar//")
     assert line.__html__() == "foo <em>bar</em>"
Ejemplo n.º 27
0
 def test_link(self):
     line = InlineMarkup("foo [[bar]]")
     assert line.__html__() == 'foo <a href="bar">bar</a>'
Ejemplo n.º 28
0
 def test_single_slashes(self):
     line = InlineMarkup("7 / 10")
     assert line.__html__() == "7 / 10"
Ejemplo n.º 29
0
 def test_external_link_with_trailing_slash(self):
     line = InlineMarkup("foo [[http://www.example.com/stuff/]]")
     assert line.__html__() == 'foo <a href="http://www.example.com/stuff/">http://www.example.com/stuff/</a>'
Ejemplo n.º 30
0
 def test_no_content(self):
     line = InlineMarkup("")
     assert line.__html__() == ""