def runTest(self): connection = sqlite3.connect(":memory:") connection.row_factory = sqlite3.Row v, v2 = [], [] table_config.create(connection) table_config.walk(connection, v.append) table_config.create(connection) table_config.walk(connection, v2.append) self.assertEquals(v, v2) table_config.update(connection, {"uuid": ""}.iteritems()) self.assertEquals(table_config.dictionarize(connection), {"version": "4.0", "uuid": ""}) table_config.update(connection, {}.iteritems(), clear=True) self.assertEquals(table_config.dictionarize(connection), {}) table_config.create(connection) print(table_config.jsonize(connection))
def merge_database(self, database): LOG.debug("config: reading properties from database") table_config.walk(database, self.merge_kv)