summary refs log tree commit diff
path: root/tests/test_utils
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-09-16 12:01:14 -0400
committerGitHub <noreply@github.com>2021-09-16 12:01:14 -0400
commitbfb4b858a999684ba2459ee4c3aa20270d13062d (patch)
treeff3830e83cb0a867f61a203e2e63133558a1bcc0 /tests/test_utils
parentAdd type hints to state database module. (#10823) (diff)
downloadsynapse-bfb4b858a999684ba2459ee4c3aa20270d13062d.tar.xz
Create a constant for a small png image in tests. (#10834)
To avoid duplicating it between a few tests.
Diffstat (limited to 'tests/test_utils')
-rw-r--r--tests/test_utils/__init__.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/test_utils/__init__.py b/tests/test_utils/__init__.py
index be6302d170..15ac2bfeba 100644
--- a/tests/test_utils/__init__.py
+++ b/tests/test_utils/__init__.py
@@ -1,5 +1,4 @@
-# Copyright 2019 New Vector Ltd
-# Copyright 2020 The Matrix.org Foundation C.I.C
+# Copyright 2019-2021 The Matrix.org Foundation C.I.C.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -19,6 +18,7 @@ Utilities for running the unit tests
 import sys
 import warnings
 from asyncio import Future
+from binascii import unhexlify
 from typing import Any, Awaitable, Callable, TypeVar
 from unittest.mock import Mock
 
@@ -117,3 +117,13 @@ class FakeResponse:
     def deliverBody(self, protocol):
         protocol.dataReceived(self.body)
         protocol.connectionLost(Failure(ResponseDone()))
+
+
+# A small image used in some tests.
+#
+# Resolution: 1×1, MIME type: image/png, Extension: png, Size: 67 B
+SMALL_PNG = unhexlify(
+    b"89504e470d0a1a0a0000000d4948445200000001000000010806"
+    b"0000001f15c4890000000a49444154789c63000100000500010d"
+    b"0a2db40000000049454e44ae426082"
+)