crypto_tests.py 1004 B

1234567891011121314151617181920212223242526272829303132
  1. import pwman.util.config as config
  2. import pwman.data.factory
  3. from pwman.data.nodes import NewNode
  4. from pwman.data.tags import Tag
  5. # set cls_timout to negative number (e.g. -1) to disable
  6. default_config = {'Global': {'umask': '0100', 'colors': 'yes',
  7. 'cls_timeout': '5'
  8. },
  9. 'Database': {'type': 'SQLite',
  10. 'filename': os.path.join("tests", "pwman.db")},
  11. 'Encryption': {'algorithm': 'AES'},
  12. 'Readline': {'history': os.path.join("tests",
  13. "history")}
  14. }
  15. config.set_defaults(default_config)
  16. import unittest
  17. class CryptoTest(unittest.TestCase):
  18. def test_no_algorithm(self):
  19. # TODO: set config to no algorithm
  20. # check that the proper exception is raised
  21. self.assertRaises()
  22. # TODO: write a white box test for each
  23. # method in CryptoEngine