Skip to content

Commit 01a7b6a

Browse files
author
Richard Jones
committed
moar test coverage
1 parent f6be6bf commit 01a7b6a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/session_common.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ def tearDown(self):
2020
if os.path.exists(config.DATABASE):
2121
shutil.rmtree(config.DATABASE)
2222

23+
def testList(self):
24+
self.sessions.list()
25+
self.sessions.set('random_key', text='hello, world!')
26+
self.sessions.list()
27+
28+
def testGetAll(self):
29+
self.sessions.set('random_key', text='hello, world!')
30+
self.assertEqual(self.sessions.getall('random_key'),
31+
{'text': 'hello, world!'})
32+
33+
def testDestroy(self):
34+
self.sessions.set('random_key', text='hello, world!')
35+
self.assertEquals(self.sessions.getall('random_key'),
36+
{'text': 'hello, world!'})
37+
self.sessions.destroy('random_key')
38+
self.assertRaises(KeyError, self.sessions.getall, 'random_key')
39+
2340
def testSetSession(self):
2441
self.sessions.set('random_key', text='hello, world!')
2542
self.assertEqual(self.sessions.get('random_key', 'text'),

0 commit comments

Comments
 (0)