annotate tests/test_db.py @ 487:1ec071454790

web: UX improvements for the sidebar menu. - Open/close the menu on click instead of mouse hover, so it's more friendly to mobile/touch devices. - Rework how the menu lock works.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 01 Nov 2018 21:25:23 -0700
parents ebb12ff21cb2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
fb6ae96756c1 Added unit tests.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
1 from tests import WikkedTest
fb6ae96756c1 Added unit tests.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
2
fb6ae96756c1 Added unit tests.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
3
fb6ae96756c1 Added unit tests.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
4 class DatabaseTest(WikkedTest):
fb6ae96756c1 Added unit tests.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
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
fb6ae96756c1 Added unit tests.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
8
fb6ae96756c1 Added unit tests.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
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
fb6ae96756c1 Added unit tests.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
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
fb6ae96756c1 Added unit tests.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
17 self.assertEqual('A test page.', page.raw_text)