summary refs log tree commit diff
path: root/tests/crypto/test_event_signing.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2019-06-20 19:32:02 +1000
committerGitHub <noreply@github.com>2019-06-20 19:32:02 +1000
commit32e7c9e7f20b57dd081023ac42d6931a8da9b3a3 (patch)
tree139ef30c957535699d1ae0474e8b5ba2517196b2 /tests/crypto/test_event_signing.py
parentMerge pull request #5042 from matrix-org/erikj/fix_get_missing_events_error (diff)
downloadsynapse-32e7c9e7f20b57dd081023ac42d6931a8da9b3a3.tar.xz
Run Black. (#5482)
Diffstat (limited to 'tests/crypto/test_event_signing.py')
-rw-r--r--tests/crypto/test_event_signing.py46
1 files changed, 23 insertions, 23 deletions
diff --git a/tests/crypto/test_event_signing.py b/tests/crypto/test_event_signing.py
index 71aa731439..126e176004 100644
--- a/tests/crypto/test_event_signing.py
+++ b/tests/crypto/test_event_signing.py
@@ -41,25 +41,25 @@ class EventSigningTestCase(unittest.TestCase):
 
     def test_sign_minimal(self):
         event_dict = {
-            'event_id': "$0:domain",
-            'origin': "domain",
-            'origin_server_ts': 1000000,
-            'signatures': {},
-            'type': "X",
-            'unsigned': {'age_ts': 1000000},
+            "event_id": "$0:domain",
+            "origin": "domain",
+            "origin_server_ts": 1000000,
+            "signatures": {},
+            "type": "X",
+            "unsigned": {"age_ts": 1000000},
         }
 
         add_hashes_and_signatures(event_dict, HOSTNAME, self.signing_key)
 
         event = FrozenEvent(event_dict)
 
-        self.assertTrue(hasattr(event, 'hashes'))
-        self.assertIn('sha256', event.hashes)
+        self.assertTrue(hasattr(event, "hashes"))
+        self.assertIn("sha256", event.hashes)
         self.assertEquals(
-            event.hashes['sha256'], "6tJjLpXtggfke8UxFhAKg82QVkJzvKOVOOSjUDK4ZSI"
+            event.hashes["sha256"], "6tJjLpXtggfke8UxFhAKg82QVkJzvKOVOOSjUDK4ZSI"
         )
 
-        self.assertTrue(hasattr(event, 'signatures'))
+        self.assertTrue(hasattr(event, "signatures"))
         self.assertIn(HOSTNAME, event.signatures)
         self.assertIn(KEY_NAME, event.signatures["domain"])
         self.assertEquals(
@@ -70,28 +70,28 @@ class EventSigningTestCase(unittest.TestCase):
 
     def test_sign_message(self):
         event_dict = {
-            'content': {'body': "Here is the message content"},
-            'event_id': "$0:domain",
-            'origin': "domain",
-            'origin_server_ts': 1000000,
-            'type': "m.room.message",
-            'room_id': "!r:domain",
-            'sender': "@u:domain",
-            'signatures': {},
-            'unsigned': {'age_ts': 1000000},
+            "content": {"body": "Here is the message content"},
+            "event_id": "$0:domain",
+            "origin": "domain",
+            "origin_server_ts": 1000000,
+            "type": "m.room.message",
+            "room_id": "!r:domain",
+            "sender": "@u:domain",
+            "signatures": {},
+            "unsigned": {"age_ts": 1000000},
         }
 
         add_hashes_and_signatures(event_dict, HOSTNAME, self.signing_key)
 
         event = FrozenEvent(event_dict)
 
-        self.assertTrue(hasattr(event, 'hashes'))
-        self.assertIn('sha256', event.hashes)
+        self.assertTrue(hasattr(event, "hashes"))
+        self.assertIn("sha256", event.hashes)
         self.assertEquals(
-            event.hashes['sha256'], "onLKD1bGljeBWQhWZ1kaP9SorVmRQNdN5aM2JYU2n/g"
+            event.hashes["sha256"], "onLKD1bGljeBWQhWZ1kaP9SorVmRQNdN5aM2JYU2n/g"
         )
 
-        self.assertTrue(hasattr(event, 'signatures'))
+        self.assertTrue(hasattr(event, "signatures"))
         self.assertIn(HOSTNAME, event.signatures)
         self.assertIn(KEY_NAME, event.signatures["domain"])
         self.assertEquals(