Mercurial > wikked
diff tests/mock.py @ 82:9afe4a1dbd1e
Refactoring of core wiki classes:
- Use proper classes instead of dictionaries more often.
- Simplified `Page`'s public API.
- Page meta property values are now always stored in an array, even if there's
only one occurence for the given key.
- Updated unit-tests.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 19 Mar 2013 19:54:11 -0700 |
parents | 2733871775cd |
children | fd6eccb24882 |
line wrap: on
line diff
--- a/tests/mock.py Wed Feb 27 22:55:11 2013 -0800 +++ b/tests/mock.py Tue Mar 19 19:54:11 2013 -0700 @@ -5,7 +5,7 @@ import logging import StringIO from wikked.page import Page -from wikked.fs import PageNotFoundError +from wikked.fs import PageInfo, PageNotFoundError from wikked.db import Database from wikked.indexer import WikiIndex from wikked.scm import SourceControl @@ -132,12 +132,9 @@ def _getPageInfo(self, node, with_content=False): path_split = os.path.splitext(node['path']) url = self.slugify(path_split[0]) - info = { - 'url': url, - 'path': node['path'] - } + info = PageInfo(url, node['path']) if with_content: - info['content'] = node['content'] + info.content = node['content'] return info def _getNode(self, path):