    def test_can_read_token_from_headers(self):
        """Tests that Sydent correct extracts an auth token from request headers"""
        self.sydent.run()

        request, _ = make_request(
            self.sydent.reactor, "GET", "/_matrix/identity/v2/hash_details"
        )
        request.requestHeaders.addRawHeader(
            b"Authorization", b"Bearer " + self.test_token.encode("ascii")
        )

        token = tokenFromRequest(request)

        self.assertEqual(token, self.test_token)