Mercurial > wikked
comparison tests/test_page.py @ 442:6a9e9e4d6b29
tests: Update URL endpoints in tests.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 29 Dec 2017 23:16:46 -0800 |
parents | 666a9d0981bb |
children | fcef742731cf |
comparison
equal
deleted
inserted
replaced
441:9d81c838f41a | 442:6a9e9e4d6b29 |
---|---|
84 second2 = wiki.getPage('/sub_dir/Second Sibling') | 84 second2 = wiki.getPage('/sub_dir/Second Sibling') |
85 self.assertEqual(['/sub_dir/Second'], second2.links) | 85 self.assertEqual(['/sub_dir/Second'], second2.links) |
86 | 86 |
87 def testGenericUrl(self): | 87 def testGenericUrl(self): |
88 wiki = self._getWikiFromStructure({ | 88 wiki = self._getWikiFromStructure({ |
89 '/foo.txt': "URL: [[url:/blah/boo/raw.txt]]" | 89 '/foo.txt': "URL: [[file:/blah/boo/raw.txt]]" |
90 }) | 90 }) |
91 foo = wiki.getPage('/foo') | 91 foo = wiki.getPage('/foo') |
92 self.assertEqual("URL: /files/blah/boo/raw.txt", foo.getFormattedText()) | 92 self.assertEqual("URL: /files/blah/boo/raw.txt", foo.getFormattedText()) |
93 | 93 |
94 def testImageUrl(self): | 94 def testImageUrl(self): |
95 wiki = self._getWikiFromStructure({ | 95 wiki = self._getWikiFromStructure({ |
96 '/foo.txt': "URL: [[blah|asset:/blah/boo/image.png]]" | 96 '/foo.txt': "URL: [[blah|image:/blah/boo/image.png]]" |
97 }) | 97 }) |
98 foo = wiki.getPage('/foo') | 98 foo = wiki.getPage('/foo') |
99 self.assertEqual("URL: <img class=\"wiki-asset\" src=\"/files/blah/boo/image.png\" alt=\"blah\"></img>", foo.getFormattedText()) | 99 self.assertEqual("URL: <img class=\"wiki-image\" src=\"/files/blah/boo/image.png\" alt=\"blah\"></img>", foo.getFormattedText()) |
100 | 100 |
101 def testUrlTemplateFunctions(self): | 101 def testUrlTemplateFunctions(self): |
102 wiki =self._getWikiFromStructure({ | 102 wiki =self._getWikiFromStructure({ |
103 '/foo.txt': "Here is {{read_url(__page.url, 'FOO')}}!" | 103 '/foo.txt': "Here is {{read_url(__page.url, 'FOO')}}!" |
104 }) | 104 }) |