summaryrefslogtreecommitdiff
path: root/macaroonbakery/tests/test_store.py
diff options
context:
space:
mode:
Diffstat (limited to 'macaroonbakery/tests/test_store.py')
-rw-r--r--macaroonbakery/tests/test_store.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/macaroonbakery/tests/test_store.py b/macaroonbakery/tests/test_store.py
new file mode 100644
index 0000000..7bcc4c2
--- /dev/null
+++ b/macaroonbakery/tests/test_store.py
@@ -0,0 +1,21 @@
+# Copyright 2017 Canonical Ltd.
+# Licensed under the LGPLv3, see LICENCE file for details.
+from unittest import TestCase
+
+import macaroonbakery
+
+
+class TestOven(TestCase):
+ def test_mem_store(self):
+ st = macaroonbakery.MemoryKeyStore()
+
+ key, id = st.root_key()
+ self.assertEqual(len(key), 24)
+ self.assertEqual(id.decode('utf-8'), '0')
+
+ key1, id1 = st.root_key()
+ self.assertEqual(key1, key)
+ self.assertEqual(id1, id)
+
+ key2 = st.get(id)
+ self.assertEqual(key2, key)