Browse Source

fix broken test

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

+ 1 - 1
pwman/data/factory.py

@@ -55,7 +55,7 @@ def create(dbtype, version=None, filename=None):
         if str(version) == '0.6':
             db = sqlite.SQLite(filename)
         else:
-            db = sqlite.SQLite(filename)
+            db = sqlite.SQLite(filename, dbformat=version)
 
     elif dbtype == "Postgresql":  # pragma: no cover
         try:

+ 2 - 1
pwman/tests/test_factory.py

@@ -49,7 +49,8 @@ class TestFactory(unittest.TestCase):
         self.assertEqual(factory.check_db_version('SQLite', testdb), 0.6)
 
     def test_factory_check_db_file(self):
-        factory.create('SQLite', version='0.3', filename='baz.db')
+        db = factory.create('SQLite', version='0.3', filename='baz.db')
+        db._open()
         self.assertEqual(factory.check_db_version('SQLite', 'baz.db'), 0.3)
         os.unlink('baz.db')