Mercurial > wikked
comparison tests/test_page.py @ 334:be7275021f3a
Fix asset URL formatting.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 19 Apr 2015 19:58:49 -0700 |
parents | ebb12ff21cb2 |
children | 666a9d0981bb |
comparison
equal
deleted
inserted
replaced
333:861b581749b0 | 334:be7275021f3a |
---|---|
73 '/First.txt': "Go to [[First Sibling]].", | 73 '/First.txt': "Go to [[First Sibling]].", |
74 '/First Sibling.txt': "Go back to [[First]], or to [[sub_dir/Second]].", | 74 '/First Sibling.txt': "Go back to [[First]], or to [[sub_dir/Second]].", |
75 '/sub_dir/Second.txt': "Go back to [[../First]], or to [[Second Sibling]].", | 75 '/sub_dir/Second.txt': "Go back to [[../First]], or to [[Second Sibling]].", |
76 '/sub_dir/Second Sibling.txt': "Go back to [[Second]]." | 76 '/sub_dir/Second Sibling.txt': "Go back to [[Second]]." |
77 }) | 77 }) |
78 print str(list(wiki.getPageUrls())) | |
79 first = wiki.getPage('/First') | 78 first = wiki.getPage('/First') |
80 self.assertEqual(['/First Sibling'], first.links) | 79 self.assertEqual(['/First Sibling'], first.links) |
81 first2 = wiki.getPage('/First Sibling') | 80 first2 = wiki.getPage('/First Sibling') |
82 self.assertEqual(['/First', '/sub_dir/Second'], first2.links) | 81 self.assertEqual(['/First', '/sub_dir/Second'], first2.links) |
83 second = wiki.getPage('/sub_dir/Second') | 82 second = wiki.getPage('/sub_dir/Second') |
92 foo = wiki.getPage('/foo') | 91 foo = wiki.getPage('/foo') |
93 self.assertEqual("URL: <a class=\"wiki-asset\" href=\"/files/blah/boo/raw.txt\">blah</a>", foo.getFormattedText()) | 92 self.assertEqual("URL: <a class=\"wiki-asset\" href=\"/files/blah/boo/raw.txt\">blah</a>", foo.getFormattedText()) |
94 | 93 |
95 def testImageUrl(self): | 94 def testImageUrl(self): |
96 wiki = self._getWikiFromStructure({ | 95 wiki = self._getWikiFromStructure({ |
97 '/foo.txt': "URL: [[blah|url:/blah/boo/image.png]]" | 96 '/foo.txt': "URL: [[blah|asset:/blah/boo/image.png]]" |
98 }) | 97 }) |
99 foo = wiki.getPage('/foo') | 98 foo = wiki.getPage('/foo') |
100 self.assertEqual("URL: <img src=\"/files/blah/boo/image.png\" alt=\"blah\"></img>", foo.getFormattedText()) | 99 self.assertEqual("URL: <img src=\"/files/blah/boo/image.png\" alt=\"blah\"></img>", foo.getFormattedText()) |
101 | 100 |
102 def testUrlTemplateFunctions(self): | 101 def testUrlTemplateFunctions(self): |