Пример #1
0
 def _loadSchemaFromDatabase():
     startTxn = store.newTransaction("test_dbUpgrades")
     schema = yield dumpSchema(
         startTxn, "Upgraded from %s" % (child.basename(), ),
         "test_dbUpgrades")
     yield startTxn.commit()
     returnValue(schema)
Пример #2
0
    def _schemaCheck(self, schema, schema_bad):

        # Load old schema and populate with data
        yield self._loadSchema(schema)

        txn = self.store.newTransaction("loadData")
        dumped = yield dumpSchema(txn, "test", schemaname="test_dbUpgrades")
        yield txn.commit()

        parsed = schemaFromString(schema)
        self.assertEqual(parsed.compare(dumped), [])

        parsed_bad = schemaFromString(schema_bad)
        self.assertNotEqual(parsed_bad.compare(dumped), [])
Пример #3
0
    def _schemaCheck(self, schema, schema_bad):

        # Load old schema and populate with data
        yield self._loadSchema(schema)

        txn = self.store.newTransaction("loadData")
        dumped = yield dumpSchema(txn, "test", schemaname="test_dbUpgrades")
        yield txn.commit()

        parsed = schemaFromString(schema)
        self.assertEqual(parsed.compare(dumped), [])

        parsed_bad = schemaFromString(schema_bad)
        self.assertNotEqual(parsed_bad.compare(dumped), [])
Пример #4
0
 def _loadSchemaFromDatabase():
     startTxn = store.newTransaction("test_dbUpgrades")
     schema = yield dumpSchema(startTxn, "Upgraded from %s" % (child.basename(),), "test_dbUpgrades")
     yield startTxn.commit()
     returnValue(schema)