comparison test/test_memorydb.py @ 6802:044dcf3608a2

update session db tests session_common.py: testList had no asserts. While adding them I found out the memory and anydbm backends return byte strings while the rdbms backend return strings. So added a call to s2b defined in each db test file to covert. rdbms i a no-op and memory/anydbm call roundup.anypy.strings::s2b(). also add some data to other tests and verify it. other files: define s2b appropriately.
author John Rouillard <rouilj@ieee.org>
date Mon, 25 Jul 2022 15:02:30 -0400
parents 7f00fc5958ca
children bdd28b244839
comparison
equal deleted inserted replaced
6801:23dbb94466e6 6802:044dcf3608a2
2 2
3 from roundup import hyperdb 3 from roundup import hyperdb
4 4
5 from .db_test_base import DBTest, ROTest, SchemaTest, config, setupSchema 5 from .db_test_base import DBTest, ROTest, SchemaTest, config, setupSchema
6 from roundup.test import memorydb 6 from roundup.test import memorydb
7
8 from roundup.anypy import strings
7 9
8 class memorydbOpener: 10 class memorydbOpener:
9 module = memorydb 11 module = memorydb
10 12
11 def nuke_database(self): 13 def nuke_database(self):
52 pass 54 pass
53 55
54 56
55 from .session_common import SessionTest 57 from .session_common import SessionTest
56 class memorydbSessionTest(memorydbOpener, SessionTest, unittest.TestCase): 58 class memorydbSessionTest(memorydbOpener, SessionTest, unittest.TestCase):
59 s2b = lambda x,y: strings.s2b(y)
60
57 def setUp(self): 61 def setUp(self):
58 self.db = self.module.Database(config, 'admin') 62 self.db = self.module.Database(config, 'admin')
59 setupSchema(self.db, 1, self.module) 63 setupSchema(self.db, 1, self.module)
60 self.sessions = self.db.sessions 64 self.sessions = self.db.sessions
61 65

Roundup Issue Tracker: http://roundup-tracker.org/