Przeglądaj źródła

Fix paths in windows

[ci skip]
Oz N Tiram 8 lat temu
rodzic
commit
b466f592b6
1 zmienionych plików z 7 dodań i 1 usunięć
  1. 7 1
      tests/test_importer.py

+ 7 - 1
tests/test_importer.py

@@ -18,6 +18,8 @@
 # ============================================================================
 import os
 import unittest
+import sys
+
 from collections import namedtuple
 import pwman.data.factory
 from pwman.util.crypto_engine import CryptoEngine
@@ -94,7 +96,11 @@ class TestImporter(unittest.TestCase):
         if os.path.exists('importdummy.db'):
             os.unlink('importdummy.db')
         args = Args(file_delim=['import_file.csv', ';'], db='importdummy.db')
-        db = pwman.data.factory.createdb('sqlite:///' + os.getcwd() +
+        p = os.getcwd()
+        if sys.platform.startswith("win"):
+            p = p.strip("C:\\")
+
+        db = pwman.data.factory.createdb('sqlite:///' + p +
                                          '/importdummy.db', 0.6)
         importer = Importer((args, '', db))
         importer.importer.run(callback=DummyCallback)