Mercurial > wikked
annotate tests/test_db.py @ 441:9d81c838f41a
web: Fix the UX for creating new pages at root vs. under a folder.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 29 Dec 2017 16:51:53 -0800 |
parents | ebb12ff21cb2 |
children |
rev | line source |
---|---|
49 | 1 from tests import WikkedTest |
2 | |
3 | |
4 class DatabaseTest(WikkedTest): | |
5 def testEmpty(self): | |
225
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
6 wiki = self._getWikiFromStructure({}) |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
7 self.assertEqual([], list(wiki.getPageUrls())) |
49 | 8 |
9 def testOnePage(self): | |
225
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
10 wiki = self._getWikiFromStructure({ |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
11 '/foo.txt': 'A test page.' |
49 | 12 }) |
225
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
13 self.assertEqual(['/foo'], list(wiki.getPageUrls())) |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
14 page = wiki.getPage('/foo') |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
15 self.assertEqual('/foo', page.url) |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
51
diff
changeset
|
16 self.assertEqual('/foo.txt', page.path) |
49 | 17 self.assertEqual('A test page.', page.raw_text) |