test_pwman.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 db_tests import (DBTests, SetupTester, CLITests, ConfigTest,
  24. TestDBFalseConfig, FactoryTest)
  25. from crypto_tests import CryptoTest
  26. from test_complete_ui import Ferrum, NEW_DB_PATH
  27. if os.path.exists(NEW_DB_PATH):
  28. os.remove(NEW_DB_PATH)
  29. # make sure we use local pwman
  30. sys.path.insert(0, os.getcwd())
  31. # check if old DB exists, if so remove it.
  32. # excuted only once when invoked upon import or
  33. # upon run
  34. SetupTester().clean()
  35. class Dumb(unittest.TestCase):
  36. def test_stupid(self):
  37. self.assertTrue(True)
  38. def suite():
  39. loader = unittest.TestLoader()
  40. suite = unittest.TestSuite()
  41. #suite.addTest(loader.loadTestsFromTestCase(DBTests))
  42. suite.addTest(loader.loadTestsFromTestCase(CryptoTest))
  43. suite.addTest(loader.loadTestsFromTestCase(CLITests))
  44. suite.addTest(loader.loadTestsFromTestCase(ConfigTest))
  45. suite.addTest(loader.loadTestsFromTestCase(FactoryTest))
  46. suite.addTest(loader.loadTestsFromTestCase(TestDBFalseConfig))
  47. suite.addTest(loader.loadTestsFromTestCase(Dumb))
  48. suite.addTest(loader.loadTestsFromTestCase(Ferrum))
  49. return suite
  50. if __name__ == '__main__':
  51. unittest.TextTestRunner(verbosity=2).run(suite())