def create(self): dbtype = config.get_value("Database", "type") if self.filename: db = factory.create(dbtype, self.dbver, self.filename) else: db = factory.create(dbtype, self.dbver) self.cli = PwmanCliNew(db, self.xselpath, DummyCallback)
def setUp(self): "test that the right db instance was created" dbver = __DB_FORMAT__ self.dbtype = config.get_value("Database", "type") self.db = factory.create(self.dbtype, dbver) self.tester = SetupTester(dbver) self.tester.create()
def test_factory_create(self): db = factory.create('SQLite', filename='foo.db') db._open() self.assertTrue(os.path.exists('foo.db')) os.unlink('foo.db') self.assertIsInstance(db, SQLiteDatabaseNewForm) self.assertRaises(DatabaseException, factory.create, 'UNKNOWN')
def setUp(self): "test that the right db instance was created" dbver = 0.4 self.dbtype = config.get_value("Database", "type") self.db = factory.create(self.dbtype, dbver) self.tester = SetupTester(dbver) self.tester.create() self.orig_config = config._conf.copy() self.orig_config['Encryption'] = {'algorithm': 'AES'}
def setUp(self): "test that the right db instance was created" self.dbtype = 'SQLite' self.db = factory.create(self.dbtype, __DB_FORMAT__, testdb) self.tester = SetupTester(__DB_FORMAT__, testdb) self.tester.create()
def test_factory_check_db_file(self): factory.create('SQLite', version='0.3', filename='baz.db') self.assertEqual(factory.check_db_version('SQLite', 'baz.db'), 0.3) os.unlink('baz.db')