summary refs log tree commit diff
path: root/tests/rest/media
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-12-02 18:58:25 +0000
committerGitHub <noreply@github.com>2020-12-02 18:58:25 +0000
commitf347f0cd581bb2dd8322a4e97c75d6b25d79db8a (patch)
tree04307f26c0e1deb650436b714b1ec5468ab2198b /tests/rest/media
parentApply an IP range blacklist to push and key revocation requests. (#8821) (diff)
downloadsynapse-f347f0cd581bb2dd8322a4e97c75d6b25d79db8a.tar.xz
remove unused FakeResponse (#8864)
Diffstat (limited to 'tests/rest/media')
-rw-r--r--tests/rest/media/v1/test_url_preview.py26
1 files changed, 0 insertions, 26 deletions
diff --git a/tests/rest/media/v1/test_url_preview.py b/tests/rest/media/v1/test_url_preview.py
index ccdc8c2ecf..529b6bcded 100644
--- a/tests/rest/media/v1/test_url_preview.py
+++ b/tests/rest/media/v1/test_url_preview.py
@@ -18,41 +18,15 @@ import re
 
 from mock import patch
 
-import attr
-
 from twisted.internet._resolver import HostResolution
 from twisted.internet.address import IPv4Address, IPv6Address
 from twisted.internet.error import DNSLookupError
-from twisted.python.failure import Failure
 from twisted.test.proto_helpers import AccumulatingProtocol
-from twisted.web._newclient import ResponseDone
 
 from tests import unittest
 from tests.server import FakeTransport
 
 
-@attr.s
-class FakeResponse:
-    version = attr.ib()
-    code = attr.ib()
-    phrase = attr.ib()
-    headers = attr.ib()
-    body = attr.ib()
-    absoluteURI = attr.ib()
-
-    @property
-    def request(self):
-        @attr.s
-        class FakeTransport:
-            absoluteURI = self.absoluteURI
-
-        return FakeTransport()
-
-    def deliverBody(self, protocol):
-        protocol.dataReceived(self.body)
-        protocol.connectionLost(Failure(ResponseDone()))
-
-
 class URLPreviewTests(unittest.HomeserverTestCase):
 
     hijack_auth = True