test_pwman.py 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/usr/bin/env python
  2. # ============================================================================
  3. # This file is part of Pwman3.
  4. #
  5. # Pwman3 is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License, version 2
  7. # as published by the Free Software Foundation;
  8. #
  9. # Pwman3 is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with Pwman3; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. # ============================================================================
  18. # Copyright (C) 2013 Oz Nahum <nahumoz@gmail.com>
  19. # ============================================================================
  20. import os
  21. import sys
  22. import unittest
  23. from .test_crypto_engine import CryptoEngineTest, TestPassGenerator
  24. from .test_config import TestConfig
  25. from .test_sqlite import TestSQLite
  26. from .test_postgresql import TestPostGresql
  27. from .test_mysql import TestMySQLDatabase
  28. from .test_mongodb import TestMongoDB
  29. from .test_importer import TestImporter
  30. from .test_factory import TestFactory
  31. from .test_base_ui import TestBaseUI
  32. from .test_init import TestInit
  33. from .test_nodes import TestNode
  34. if 'win' not in sys.platform:
  35. from .test_complete_ui import (Ferrum)
  36. # make sure we use local pwman
  37. sys.path.insert(0, os.getcwd())
  38. # check if old DB exists, if so remove it.
  39. # excuted only once when invoked upon import or
  40. # upon run
  41. # SetupTester().clean()
  42. def suite():
  43. loader = unittest.TestLoader()
  44. suite = unittest.TestSuite()
  45. suite.addTest(loader.loadTestsFromTestCase(CryptoEngineTest))
  46. suite.addTest(loader.loadTestsFromTestCase(TestPassGenerator))
  47. suite.addTest(loader.loadTestsFromTestCase(TestConfig))
  48. suite.addTest(loader.loadTestsFromTestCase(TestSQLite))
  49. suite.addTest(loader.loadTestsFromTestCase(TestPostGresql))
  50. suite.addTest(loader.loadTestsFromTestCase(TestMySQLDatabase))
  51. suite.addTest(loader.loadTestsFromTestCase(TestMongoDB))
  52. suite.addTest(loader.loadTestsFromTestCase(TestImporter))
  53. suite.addTest(loader.loadTestsFromTestCase(TestFactory))
  54. suite.addTest(loader.loadTestsFromTestCase(TestBaseUI))
  55. suite.addTest(loader.loadTestsFromTestCase(TestInit))
  56. suite.addTest(loader.loadTestsFromTestCase(TestNode))
  57. if 'win' not in sys.platform:
  58. suite.addTest(loader.loadTestsFromTestCase(Ferrum))
  59. return suite
  60. if __name__ == '__main__':
  61. unittest.main(verbosity=2, failfast=True)