summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/unit/keymanager/test_unit_keymanager.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/unit/keymanager/test_unit_keymanager.py b/tests/unit/keymanager/test_unit_keymanager.py
new file mode 100644
index 0000000..94e73d0
--- /dev/null
+++ b/tests/unit/keymanager/test_unit_keymanager.py
@@ -0,0 +1,25 @@
+from twisted.trial import unittest
+
+from leap.bitmask.keymanager import KeyManager
+
+
+class KeymanagerTestCase(unittest.TestCase):
+
+ def test_token_propagation(self):
+ km = keymanagerFactory()
+ assert km._nicknym.token == ''
+ km.token = 'sometoken'
+ assert km.token == 'sometoken'
+ assert km._nicknym.token == 'sometoken'
+ km.token = 'othertoken'
+ assert km.token == 'othertoken'
+ assert km._nicknym.token == 'othertoken'
+
+
+def keymanagerFactory():
+
+ class DummyKeymanager(KeyManager):
+ def _init_gpg(self, soledad, gpg):
+ pass
+
+ return DummyKeymanager('foo@localhost', 'localhost', None, token='')