|
@@ -1,8 +1,9 @@
|
|
|
import pwman.util.config as config
|
|
|
+import os
|
|
|
import pwman.data.factory
|
|
|
from pwman.data.nodes import NewNode
|
|
|
from pwman.data.tags import Tag
|
|
|
-
|
|
|
+from pwman.util.crypto import CryptoEngine, CryptoException
|
|
|
# set cls_timout to negative number (e.g. -1) to disable
|
|
|
default_config = {'Global': {'umask': '0100', 'colors': 'yes',
|
|
|
'cls_timeout': '5'
|
|
@@ -21,9 +22,8 @@ import unittest
|
|
|
class CryptoTest(unittest.TestCase):
|
|
|
|
|
|
def test_no_algorithm(self):
|
|
|
- # TODO: set config to no algorithm
|
|
|
- # check that the proper exception is raised
|
|
|
- self.assertRaises()
|
|
|
+ config.set_value('Encryption', 'algorithm', '')
|
|
|
+ self.assertRaises((CryptoException,), CryptoEngine)
|
|
|
|
|
|
# TODO: write a white box test for each
|
|
|
# method in CryptoEngine
|