Code

moar test coverage
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Sat, 10 Jul 2010 03:57:45 +0000 (03:57 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Sat, 10 Jul 2010 03:57:45 +0000 (03:57 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4492 57a73879-2fb5-44c3-a270-3262357dd7e2

test/session_common.py

index 8a9077017419e2d798842f9ea76c9dc7d31e47e5..c9223ffbdc6267ee7fe15b5fb0c62dd2f941fcc0 100644 (file)
@@ -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'),