Explorar el Código

Clean all old test dbs

Remove README
oz123 hace 10 años
padre
commit
72e28efbd3
Se han modificado 6 ficheros con 4 adiciones y 41 borrados
  1. 1 10
      pwman/__init__.py
  2. 0 7
      tests/README.md
  3. BIN
      tests/pwman-newdb.db
  4. BIN
      tests/pwman.v0.0.8.db
  5. 3 24
      tests/test_complete_ui.py
  6. BIN
      tests/v0.5.1b.aes.db

+ 1 - 10
pwman/__init__.py

@@ -33,7 +33,7 @@ appname = "pwman3"
 try:
     version = pkg_resources.get_distribution('pwman3').version
 except pkg_resources.DistributionNotFound:  # pragma: no cover
-    version = "0.5"
+    version = "0.6"
 
 website = "http://pwman3.github.io/pwman3/"
 author = "Oz Nahum Tiram"
@@ -45,15 +45,6 @@ long_description = (u"Pwman3 aims to provide a simple but powerful command "
                     "to store your password in database locked by "
                     "a\nmaster password which is AES encrypted.")
 
-_db_warn = (u"pwman3 detected that you are using the old database format"
-            " which is insecure."
-            " pwman3 will try to automatically convert the database now."
-            "\n"
-            "If you choose not to convert the database, pwman3, will quit."
-            "\nYou can check the help (pwman3 -h) or look at the manpage how "
-            "to convert the database manually."
-            )
-
 
 def which(cmd):  # pragma: no cover
     _, cmdname = os.path.split(cmd)

+ 0 - 7
tests/README.md

@@ -1,7 +0,0 @@
-The databases found here are for testing purposes. 
-The following describes them:
-
- - pwman.db.v0.0.8 
-   Blowfish encryption, password 12345
- - pwman-newdb.db 
-   The result of convertion of the above database.

BIN
tests/pwman-newdb.db


BIN
tests/pwman.v0.0.8.db


+ 3 - 24
tests/test_complete_ui.py

@@ -23,11 +23,6 @@ import unittest
 import os
 import shutil
 
-OLD_DB_PATH = os.path.join(os.path.dirname(__file__), 'pwman.v0.0.8.db')
-NEW_DB_PATH = os.path.join(os.path.dirname(__file__), 'pwman.v0.0.8-newdb.db')
-
-_db_warn = ("pwman3 detected that you are using the old database format")
-
 
 class Ferrum(unittest.TestCase):
     def clean_files(self):
@@ -42,27 +37,12 @@ class Ferrum(unittest.TestCase):
         os.remove('test-chg_passwd.log')
         os.remove(backup)
 
-    def test_a_db_warning(self):
-        "when trying to run with old db, we should see warning"
-        lfile = 'convert-test.log'
-        logfile = open(lfile, 'wb')
-        cmd = os.path.join(os.path.dirname(__file__), '../../scripts/pwman3'
-                           ) + ' -d '+OLD_DB_PATH
-        child = pexpect.spawn(cmd, logfile=logfile)
-
-        rv = child.expect(_db_warn, timeout=5)
-        if rv != 0:
-            lfile.seek(0)
-            print(lfile.readlines())
-
-        self.assertEqual(0, rv)
-
     def test_b_run_convert(self):
         "invoke pwman with -k option to convert the old data"
         lfile = 'convert-test.log'
         logfile = open(lfile, 'wb')
-        cmd = (os.path.join(os.path.dirname(__file__), '../../scripts/pwman3'
-                            ) + ' -k -e Blowfish -d ' + OLD_DB_PATH)
+        cmd = (os.path.join(os.path.dirname(__file__), '../scripts/pwman3'
+                            ) + ' -k -e Blowfish -d ')
         child = pexpect.spawn(cmd, logfile=logfile)
         child.expect('[\s|\S]+Please enter your password:', timeout=10)
         self.assertEqual(6, child.sendline('12345'))
@@ -77,7 +57,7 @@ class Ferrum(unittest.TestCase):
         logfile = open(lfile, 'wb')
         child = pexpect.spawn(os.path.join(os.path.dirname(__file__),
                                            '../../scripts/pwman3') +
-                              ' -e Blowfish -d '+OLD_DB_PATH, logfile=logfile)
+                              ' -d ', logfile=logfile)
         child.sendline('passwd')
         child.expect("Please enter your current password:")
         child.sendline('12345')
@@ -94,4 +74,3 @@ def suite():
 
 if __name__ == '__main__':
     unittest.TextTestRunner(verbosity=2).run(suite())
-    os.remove(NEW_DB_PATH)

BIN
tests/v0.5.1b.aes.db