Mercurial > wikked
comparison tests/__init__.py @ 83:65f83a9b42f1
Added support for numbered template parameters.
Moved resolver code into its own file.
Added unit tests.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 24 Mar 2013 22:06:50 -0700 |
parents | 9dfbc2a40b71 |
children | ebb12ff21cb2 |
comparison
equal
deleted
inserted
replaced
82:9afe4a1dbd1e | 83:65f83a9b42f1 |
---|---|
1 import os | 1 import os |
2 import os.path | 2 import os.path |
3 import shutil | 3 import shutil |
4 import unittest | 4 import unittest |
5 from wikked.wiki import Wiki | 5 from wikked.wiki import Wiki |
6 from mock import MockWikiParameters | 6 from mock import MockWikiParameters, MockFileSystem |
7 | 7 |
8 | 8 |
9 class WikkedTest(unittest.TestCase): | 9 class WikkedTest(unittest.TestCase): |
10 def setUp(self): | 10 def setUp(self): |
11 # Directory you can use for temporary files. | 11 # Directory you can use for temporary files. |
30 return wiki | 30 return wiki |
31 | 31 |
32 def getParameters(self): | 32 def getParameters(self): |
33 return MockWikiParameters() | 33 return MockWikiParameters() |
34 | 34 |
35 def _getWikiFromStructure(self, structure): | |
36 wiki = self.getWiki(use_db=False, fs_factory=lambda cfg: MockFileSystem(structure)) | |
37 wiki.start() | |
38 return wiki | |
39 | |
35 | 40 |
36 def format_link(title, url, missing=False, mod=None): | 41 def format_link(title, url, missing=False, mod=None): |
37 res = '<a class=\"wiki-link' | 42 res = '<a class=\"wiki-link' |
38 if missing: | 43 if missing: |
39 res += ' missing' | 44 res += ' missing' |