Mercurial > wikked
annotate tests/test_db.py @ 439:debeff30d9bd
update: Do a reset if the DB requires an upgrade.
| author | Ludovic Chabant <ludovic@chabant.com> |
|---|---|
| date | Mon, 17 Apr 2017 21:36:49 -0700 |
| 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) |
