Beispiel #1
0
    def runTest(self):

        connection = sqlite3.connect(":memory:")
        connection.row_factory = sqlite3.Row

        v, v2 = [], []
        table_config.create(connection)
        for name, value in table_config.dictionarize(connection).items():
            v.append((name, value))
        table_config.create(connection)
        for name, value in table_config.dictionarize(connection).items():
            v2.append((name, value))
        self.assertEquals(v, v2)

        table_config.update(connection, {"uuid": ""}.iteritems())
        result = table_config.dictionarize(connection)
        #
        # The version number changes as time passes and we don't
        # want to keep the test uptodate.
        #
        del result['version']
        self.assertEquals(result, {"uuid": ""})

        table_config.update(connection, {}.iteritems(), clear=True)
        self.assertEquals(table_config.dictionarize(connection), {})

        table_config.create(connection)
        print(table_config.jsonize(connection))
Beispiel #2
0
    def runTest(self):

        connection = sqlite3.connect(":memory:")
        connection.row_factory = sqlite3.Row

        v, v2 = [], []
        table_config.create(connection)
        for name, value in table_config.dictionarize(connection).items():
            v.append((name, value))
        table_config.create(connection)
        for name, value in table_config.dictionarize(connection).items():
            v2.append((name, value))
        self.assertEquals(v, v2)

        table_config.update(connection, {"uuid": ""}.iteritems())
        result = table_config.dictionarize(connection)
        #
        # The version number changes as time passes and we don't
        # want to keep the test uptodate.
        #
        del result['version']
        self.assertEquals(result, {"uuid": ""})

        table_config.update(connection, {}.iteritems(), clear=True)
        self.assertEquals(table_config.dictionarize(connection), {})

        table_config.create(connection)
        print(table_config.jsonize(connection))
Beispiel #3
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))