From f6540a96ced1bab98b2045732fa630da585620c4 Mon Sep 17 00:00:00 2001 From: richard Date: Sat, 10 Jul 2010 03:57:45 +0000 Subject: [PATCH] moar test coverage git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4492 57a73879-2fb5-44c3-a270-3262357dd7e2 --- test/session_common.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/session_common.py b/test/session_common.py index 8a90770..c9223ff 100644 --- a/test/session_common.py +++ b/test/session_common.py @@ -20,6 +20,23 @@ class SessionTest(unittest.TestCase): if os.path.exists(config.DATABASE): shutil.rmtree(config.DATABASE) + def testList(self): + self.sessions.list() + self.sessions.set('random_key', text='hello, world!') + self.sessions.list() + + def testGetAll(self): + self.sessions.set('random_key', text='hello, world!') + self.assertEqual(self.sessions.getall('random_key'), + {'text': 'hello, world!'}) + + def testDestroy(self): + self.sessions.set('random_key', text='hello, world!') + self.assertEquals(self.sessions.getall('random_key'), + {'text': 'hello, world!'}) + self.sessions.destroy('random_key') + self.assertRaises(KeyError, self.sessions.getall, 'random_key') + def testSetSession(self): self.sessions.set('random_key', text='hello, world!') self.assertEqual(self.sessions.get('random_key', 'text'), -- 2.30.2