コード例 #1
0
ファイル: test_tools.py プロジェクト: hbrunn/pwman3
 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)
コード例 #2
0
ファイル: db_tests.py プロジェクト: hbrunn/pwman3
 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()
コード例 #3
0
ファイル: db_tests.py プロジェクト: hbrunn/pwman3
 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')
コード例 #4
0
ファイル: db_tests.py プロジェクト: hbrunn/pwman3
 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'}
コード例 #5
0
ファイル: db_tests.py プロジェクト: yujingjiangshui9/pwman3
 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()
コード例 #6
0
ファイル: db_tests.py プロジェクト: yujingjiangshui9/pwman3
 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')
コード例 #7
0
ファイル: db_tests.py プロジェクト: pwman3/pwman3
 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()
コード例 #8
0
ファイル: db_tests.py プロジェクト: pwman3/pwman3
 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')