|
@@ -3,7 +3,7 @@ import os
|
|
import pwman.data.factory
|
|
import pwman.data.factory
|
|
from pwman.data.nodes import NewNode
|
|
from pwman.data.nodes import NewNode
|
|
from pwman.data.tags import Tag
|
|
from pwman.data.tags import Tag
|
|
-from pwman.util.crypto import CryptoEngine, CryptoException
|
|
|
|
|
|
+from pwman.util.crypto import CryptoEngine, CryptoException, CryptoNoCallbackException
|
|
# set cls_timout to negative number (e.g. -1) to disable
|
|
# set cls_timout to negative number (e.g. -1) to disable
|
|
default_config = {'Global': {'umask': '0100', 'colors': 'yes',
|
|
default_config = {'Global': {'umask': '0100', 'colors': 'yes',
|
|
'cls_timeout': '5'
|
|
'cls_timeout': '5'
|
|
@@ -25,8 +25,12 @@ class CryptoTest(unittest.TestCase):
|
|
config.set_value('Encryption', 'algorithm', '')
|
|
config.set_value('Encryption', 'algorithm', '')
|
|
self.assertRaises((CryptoException,), CryptoEngine)
|
|
self.assertRaises((CryptoException,), CryptoEngine)
|
|
|
|
|
|
- # TODO: write a white box test for each
|
|
|
|
- # method in CryptoEngine
|
|
|
|
|
|
+ def test_getcipher(self):
|
|
|
|
+ crypto = CryptoEngine()
|
|
|
|
+ self.assertRaises((CryptoNoCallbackException,), crypto._getcipher)
|
|
|
|
|
|
|
|
+ def test_prepare_data(self):
|
|
|
|
+ obj='dummy_data'
|
|
|
|
+ self.assertTrue(True)
|
|
|
|
|
|
|
|
|