Ejemplo n.º 1
0
    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))
Ejemplo n.º 2
0
 def merge_database(self, database):
     LOG.debug("config: reading properties from database")
     table_config.walk(database, self.merge_kv)