Browse Source

Update factory and test_factory

oz123 10 years ago
parent
commit
fc71d29161
2 changed files with 4 additions and 4 deletions
  1. 2 2
      pwman/data/factory.py
  2. 2 2
      pwman/tests/test_factory.py

+ 2 - 2
pwman/data/factory.py

@@ -45,7 +45,7 @@ class FactoryException(Exception):
 
 def check_db_version(ftype, filename):
     if ftype == "SQLite":
-        ver = sqlite.SQLiteDatabaseNewForm.check_db_version(filename)
+        ver = sqlite.SQLite.check_db_version(filename)
         try:
             return float(ver.strip("\'"))
         except ValueError:
@@ -64,7 +64,7 @@ def create(dbtype, version=None, filename=None):
         if str(version) == '0.6':
             db = sqlite.SQLite(filename)
         else:
-            db = sqlite.SQLiteDatabaseNewForm(filename)
+            db = sqlite.SQLite(filename)
 
     elif dbtype == "Postgresql":  # pragma: no cover
         try:

+ 2 - 2
pwman/tests/test_factory.py

@@ -20,7 +20,7 @@
 #from pwman.data.nodes import NewNode
 #from pwman.data.tags import TagNew
 from pwman.data import factory
-from pwman.data.drivers.sqlite import DatabaseException, SQLiteDatabaseNewForm
+from pwman.data.drivers.sqlite import DatabaseException, SQLite
 from pwman.ui import get_ui_platform
 from pwman.data.database import __DB_FORMAT__
 import sys
@@ -87,7 +87,7 @@ class TestFactory(unittest.TestCase):
         self.assertTrue(os.path.exists('foo.db'))
         db.close()
         os.unlink('foo.db')
-        self.assertIsInstance(db, SQLiteDatabaseNewForm)
+        self.assertIsInstance(db, SQLite)
         self.assertRaises(DatabaseException, factory.create, 'UNKNOWN')