From: richard Date: Sat, 10 Jul 2010 03:57:45 +0000 (+0000) Subject: moar test coverage X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f6540a96ced1bab98b2045732fa630da585620c4;p=roundup.git moar test coverage git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4492 57a73879-2fb5-44c3-a270-3262357dd7e2 --- 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'),