Explorar o código

Code clean up in testing

oz123 %!s(int64=10) %!d(string=hai) anos
pai
achega
48cf1f2090
Modificáronse 3 ficheiros con 22 adicións e 50 borrados
  1. 6 38
      pwman/tests/test_factory.py
  2. 1 2
      pwman/tests/test_pwman.py
  3. 15 10
      setup.py

+ 6 - 38
pwman/tests/test_factory.py

@@ -17,51 +17,19 @@
 # Copyright (C) 2013-2014 Oz Nahum Tiram <nahumoz@gmail.com>
 # Copyright (C) 2013-2014 Oz Nahum Tiram <nahumoz@gmail.com>
 # ============================================================================
 # ============================================================================
 
 
-#from pwman.data.nodes import NewNode
-#from pwman.data.tags import TagNew
-from pwman.data import factory
-from pwman.data.drivers.sqlite import DatabaseException, SQLite
-from pwman.ui import get_ui_platform
-from pwman.data.database import __DB_FORMAT__
 import sys
 import sys
 import unittest
 import unittest
 import os
 import os
 import os.path
 import os.path
-
-dummyfile = """
-[Encryption]
-
-[Readline]
-
-[Global]
-xsel = /usr/bin/xsel
-colors = yes
-umask = 0100
-cls_timeout = 5
-
-[Database]
-"""
-
-
-#def node_factory(username, password, url, notes, tags=None):
-#    node = NewNode()
-#    node.username = username
-#    node.password = password
-#    node.url = url
-#    node.notes = notes
-#    tags = [TagNew(tn) for tn in tags]
-#    node.tags = tags
-
-#    return node
-
-_saveconfig = False
-
-PwmanCliNew, OSX = get_ui_platform(sys.platform)
-
-
+from pwman.data import factory
+from pwman.data.drivers.sqlite import DatabaseException, SQLite
+from pwman.ui import get_ui_platform
+from pwman.data.database import __DB_FORMAT__
 from .test_tools import (SetupTester)
 from .test_tools import (SetupTester)
 
 
+PwmanCliNew, OSX = get_ui_platform(sys.platform)
 testdb = os.path.join(os.path.dirname(__file__), "test.pwman.db")
 testdb = os.path.join(os.path.dirname(__file__), "test.pwman.db")
+_saveconfig = False
 
 
 
 
 class TestFactory(unittest.TestCase):
 class TestFactory(unittest.TestCase):

+ 1 - 2
pwman/tests/test_pwman.py

@@ -21,7 +21,6 @@
 import os
 import os
 import sys
 import sys
 import unittest
 import unittest
-from .db_tests import (SetupTester)
 from .test_crypto_engine import CryptoEngineTest, TestPassGenerator
 from .test_crypto_engine import CryptoEngineTest, TestPassGenerator
 from .test_config import TestConfig
 from .test_config import TestConfig
 from .test_sqlite import TestSQLite
 from .test_sqlite import TestSQLite
@@ -42,7 +41,7 @@ sys.path.insert(0, os.getcwd())
 # check if old DB exists, if so remove it.
 # check if old DB exists, if so remove it.
 # excuted only once when invoked upon import or
 # excuted only once when invoked upon import or
 # upon run
 # upon run
-SetupTester().clean()
+# SetupTester().clean()
 
 
 
 
 def suite():
 def suite():

+ 15 - 10
setup.py

@@ -117,6 +117,7 @@ class BuildManPage(Command):
 
 
 
 
 class ManPageFormatter(argparse.HelpFormatter):
 class ManPageFormatter(argparse.HelpFormatter):
+
     """
     """
     Formatter class to create man pages.
     Formatter class to create man pages.
     This class relies only on the parser, and not distutils.
     This class relies only on the parser, and not distutils.
@@ -275,6 +276,7 @@ class ManPageFormatter(argparse.HelpFormatter):
 
 
 
 
 class ManPageCreator(object):
 class ManPageCreator(object):
+
     """
     """
     This class takes a little different approach. Instead of relying on
     This class takes a little different approach. Instead of relying on
     information from ArgumentParser, it relies on information retrieved
     information from ArgumentParser, it relies on information retrieved
@@ -351,16 +353,19 @@ setup(name=pwman.appname,
       install_requires=['pycrypto>=2.6',
       install_requires=['pycrypto>=2.6',
                         'colorama>=0.2.4'],
                         'colorama>=0.2.4'],
       keywords="password-manager crypto cli",
       keywords="password-manager crypto cli",
-      classifiers=[
-          'Environment :: Console',
-          'Intended Audience :: End Users/Desktop',
-          'Intended Audience :: Developers',
-          'Intended Audience :: System Administrators',
-          'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
-          'Operating System :: OS Independent',
-          'Programming Language :: Python',
-          'Programming Language :: Python :: 2.7'
-      ],
+      classifiers=['Environment :: Console',
+                   'Intended Audience :: End Users/Desktop',
+                   'Intended Audience :: Developers',
+                   'Intended Audience :: System Administrators',
+                   'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
+                   'Operating System :: OS Independent',
+                   'Programming Language :: Python',
+                   'Programming Language :: Python :: 2.7'
+                   'Programming Language :: Python :: 3',
+                   'Programming Language :: Python :: 3.2',
+                   'Programming Language :: Python :: 3.3',
+                   'Programming Language :: Python :: 3.4',
+                   ],
       test_suite='pwman.tests.suite',
       test_suite='pwman.tests.suite',
       tests_require=test_requirements,
       tests_require=test_requirements,
       cmdclass={
       cmdclass={