Permalink
Browse files

Add more link tests.

  • Loading branch information...
1 parent a6df4b2 commit dbeb4d79426076ecfe23fc08ad520ecc17a2e5e6 @Sepero Sepero committed with Sep 3, 2012
Showing with 46 additions and 0 deletions.
  1. +46 −0 creole/tests/test_creole2html.py
@@ -539,6 +539,52 @@ def test_tt(self):
...and <tt><strong>strong</strong> Teletyper</tt> ;)</p>
""")
+ def test_protocol_in_brackets(self):
+ self.assert_creole2html(r"""
+ My Server ([[ftp://foo/bar]]) is ok.
+ """, """
+ <p>My Server (<a href="ftp://foo/bar">ftp://foo/bar</a>) is ok.</p>
+ """)
+ self.assert_creole2html(r"""
+ My Server (ftp://foo/bar) is ok.
+ """, """
+ <p>My Server (<a href="ftp://foo/bar">ftp://foo/bar</a>) is ok.</p>
+ """)
+
+ def test_protocol_with_brackets(self):
+ self.assert_creole2html(r"""
+ A http://en.wikipedia.org/wiki/Uri_(Island) link.
+ """, """
+ <p>A <a href="http://en.wikipedia.org/wiki/Uri_(Island)">http://en.wikipedia.org/wiki/Uri_(Island)</a>) link.</p>
+ """)
+
+ def test_wrong_protocol(self):
+ self.assert_creole2html(r"""
+ ~ftp://ok
+ """, """
+ <p>ftp://ok</p>
+ """)
+ self.assert_creole2html(r"""
+ ftp:
+ """, """
+ <p>ftp:</p>
+ """)
+ self.assert_creole2html(r"""
+ ftp:/
+ """, """
+ <p>ftp:/</p>
+ """)
+ self.assert_creole2html(r"""
+ missing space.ftp://ok
+ """, """
+ <p>missing space.ftp://ok</p>
+ """)
+ self.assert_creole2html(r"""
+ ftp://ok(Also missed space)
+ """, """
+ <p>ftp://ok(Also missed space)</p>
+ """)
+
class TestStr2Dict(unittest.TestCase):
def test_basic(self):

0 comments on commit dbeb4d7

Please sign in to comment.