Pārlūkot izejas kodu

Migrate all tests to top level

oz123 10 gadi atpakaļ
vecāks
revīzija
ae9939bb19

+ 2 - 1
Makefile

@@ -33,12 +33,13 @@ clean-pyc:
 	find . -name '*.pyc' -exec rm -f {} +
 	find . -name '*.pyo' -exec rm -f {} +
 	find . -name '*~' -exec rm -f {} +
+	find . -name '__pycache__' -exec rm -rf {} +
 
 lint:
 	flake8 pwman scripts
 
 test: install clean
-	git checkout pwman/tests/pwman.v0.0.8.db
+	git checkout tests/pwman.v0.0.8.db
 	python setup.py test
 	@rm -f pwman/tests/test.conf
 

+ 0 - 13
pwman/tests/__init__.py

@@ -1,13 +0,0 @@
-import unittest
-from . import test_pwman
-
-
-def suite():
-    import unittest
-    suite = unittest.TestSuite()
-    suite.addTests(test_pwman.suite())
-    return suite
-
-
-if __name__ == '__main__':
-    unittest.TextTestRunner(verbosity=2).run(suite())

+ 2 - 7
setup.py

@@ -340,12 +340,7 @@ setup(name=pwman.appname,
       author_email=pwman.authoremail,
       url=pwman.website,
       license="GNU GPL",
-      packages=['pwman',
-                'pwman.data',
-                'pwman.data.drivers',
-                'pwman.exchange',
-                'pwman.ui',
-                'pwman.util'],
+      packages=['pwman'],
       package_data={"data": ["documentation"]},
       include_package_data=True,
       scripts=['scripts/pwman3'],
@@ -366,7 +361,7 @@ setup(name=pwman.appname,
                    'Programming Language :: Python :: 3.3',
                    'Programming Language :: Python :: 3.4',
                    ],
-      test_suite='pwman.tests.suite',
+      test_suite='tests.test_pwman.suite',
       tests_require=test_requirements,
       cmdclass={
           'install_pycrypto': PyCryptoInstallCommand,

+ 0 - 0
pwman/tests/README.md → tests/README.md


+ 1 - 0
tests/__init__.py

@@ -0,0 +1 @@
+

+ 0 - 0
pwman/tests/crypto_tests.py → tests/crypto_tests.py


+ 0 - 0
pwman/tests/db_tests.py → tests/db_tests.py


+ 0 - 0
pwman/tests/pwman-newdb.db → tests/pwman-newdb.db


+ 0 - 0
pwman/tests/pwman.db.aes.encryption → tests/pwman.db.aes.encryption


+ 0 - 0
pwman/tests/pwman.db.no.encryption → tests/pwman.db.no.encryption


+ 0 - 0
pwman/tests/pwman.v0.0.8.db → tests/pwman.v0.0.8.db


+ 0 - 0
pwman/tests/test_base_ui.py → tests/test_base_ui.py


+ 0 - 0
pwman/tests/test_complete_ui.py → tests/test_complete_ui.py


+ 0 - 0
pwman/tests/test_config.py → tests/test_config.py


+ 0 - 0
pwman/tests/test_converter.py → tests/test_converter.py


+ 0 - 0
pwman/tests/test_crypto_engine.py → tests/test_crypto_engine.py


+ 0 - 0
pwman/tests/test_factory.py → tests/test_factory.py


+ 0 - 0
pwman/tests/test_importer.py → tests/test_importer.py


+ 0 - 0
pwman/tests/test_init.py → tests/test_init.py


+ 2 - 2
pwman/tests/test_mysql.py → tests/test_mysql.py

@@ -24,7 +24,7 @@ if sys.version_info.major > 2:  # pragma: no cover
 else:  # pragma: no cover
     from urlparse import urlparse
 
-from pymysql import connections
+import pymysql
 from pwman.data.drivers.mysql import MySQLDatabase
 from pwman.util.crypto_engine import CryptoEngine
 
@@ -50,7 +50,7 @@ class TestMySQLDatabase(unittest.TestCase):
         self.db._con.commit()
 
     def test_1_con(self):
-        self.assertIsInstance(self.db._con, connections.Connection)
+        self.assertIsInstance(self.db._con, pymysql.connections.Connection)
 
     def test_2_create_tables(self):
         self.db._create_tables()

+ 0 - 0
pwman/tests/test_nodes.py → tests/test_nodes.py


+ 0 - 0
pwman/tests/test_postgresql.py → tests/test_postgresql.py


+ 0 - 8
pwman/tests/test_pwman.py → tests/test_pwman.py

@@ -65,11 +65,3 @@ def suite():
     # if 'win' not in sys.platform:
     #    suite.addTest(loader.loadTestsFromTestCase(Ferrum))
     return suite
-
-if __name__ == '__main__':
-    try:
-        unittest.TextTestRunner(verbosity=2, failfast=True).run(suite())
-    except SystemExit:
-        TestConfig.clean_all()
-        TestBaseUI.clean_all()
-        TestImporter.clean_all()

+ 0 - 0
pwman/tests/test_sqlite.py → tests/test_sqlite.py


+ 0 - 0
pwman/tests/test_tools.py → tests/test_tools.py


+ 0 - 0
pwman/tests/v0.5.1b.aes.db → tests/v0.5.1b.aes.db