summary refs log tree commit diff
path: root/tests/utils.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-09-24 17:25:41 +0100
committerMark Haines <mark.haines@matrix.org>2014-09-24 17:25:41 +0100
commit52ca8676700368098ca0689c424f972ac54ac780 (patch)
tree43bc0d4caeb33bc342f5b5a604dcfd0eac89cb4f /tests/utils.py
parentFix a few pyflakes errors in the server_key_resource (diff)
downloadsynapse-52ca8676700368098ca0689c424f972ac54ac780.tar.xz
Sign federation transactions
Diffstat (limited to '')
-rw-r--r--tests/utils.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/utils.py b/tests/utils.py
index bc5d35e56b..beb2aef084 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -108,6 +108,21 @@ class MockHttpResource(HttpServer):
         self.callbacks.append((method, path_pattern, callback))
 
 
+class MockKey(object):
+    alg = "mock_alg"
+    version = "mock_version"
+
+    @property
+    def verify_key(self):
+        return self
+
+    def sign(self, message):
+        return b"\x9a\x87$"
+
+    def verify(self, message, sig):
+        assert sig == b"\x9a\x87$"
+
+
 class MockClock(object):
     now = 1000