Browse Source

Try fixing build on windows again

Oz N Tiram 8 years ago
parent
commit
a66c5b9374
2 changed files with 6 additions and 19 deletions
  1. 2 6
      tests/test_base_ui.py
  2. 4 13
      tests/test_tools.py

+ 2 - 6
tests/test_base_ui.py

@@ -24,14 +24,10 @@ from io import StringIO, BytesIO
 from pwman.util.crypto_engine import CryptoEngine
 from .test_crypto_engine import give_key, DummyCallback
 from pwman.data.database import __DB_FORMAT__
-from .test_tools import (SetupTester)
+from .test_tools import (SetupTester, testdb)
 from pwman.data import factory
 from pwman.data.nodes import Node
 
-db =  ".".join(("test-baseui","pwman", sys.version.split(" " ,1)[0], "db"))
-testdb = os.path.abspath(os.path.join(os.path.dirname(__file__), db))
-
-print(testdb)
 
 class dummy_stdin(object):
 
@@ -186,7 +182,7 @@ class TestBaseUI(unittest.TestCase):
         self.output = StringIO()
         sys.stdout = self.output
         self.tester.cli.do_info(b'')
-        self.assertIn("test.pwman.db", sys.stdout.getvalue())
+        self.assertIn(testdb, sys.stdout.getvalue())
 
 if __name__ == '__main__':
 

+ 4 - 13
tests/test_tools.py

@@ -65,15 +65,13 @@ class DummyCallback4(Callback):
     def getsecret(self, question):
         return b'newsecret'
 
+db =  ".".join(("pwman","test", sys.version.split(" " ,1)[0], "db"))
+testdb = os.path.abspath(os.path.join(os.path.dirname(__file__), db))
 
 config.default_config['Database'] = {'type': 'sqlite',
-                                     'filename':
-                                     os.path.join(os.path.dirname(__file__),
-                                                  "test.pwman.db"),
+                                     'filename': testdb,
                                      'dburi': os.path.join(
-                                         'sqlite:///',
-                                         os.path.dirname(__file__),
-                                         "test.pwman.db")
+                                         'sqlite:///', testdb)
                                      }
 
 dc = """
@@ -88,10 +86,6 @@ type = SQLite
 """
 
 
-db =  ".".join(("pwman","test", sys.version.split(" " ,1)[0], "db"))
-testdb = os.path.abspath(os.path.join(os.path.dirname(__file__), db))
-
-
 class SetupTester(object):
 
     def __init__(self, dbver=None, filename=None, dburi=None):
@@ -139,6 +133,3 @@ class SetupTester(object):
         db = factory.createdb(self.dburi, self.dbver)
         self.cli = PwmanCliNew(db, self.xselpath, DummyCallback,
                                config_parser=self.configp)
-
-    def __del__(self):
-        self.cli.do_exit("")