Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
86c60bda
Commit
86c60bda
authored
6 years ago
by
Andrew Morgan
Browse files
Options
Downloads
Patches
Plain Diff
i should have given up x3
parent
45524f2f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/http/test_fedclient.py
+0
-39
0 additions, 39 deletions
tests/http/test_fedclient.py
with
0 additions
and
39 deletions
tests/http/test_fedclient.py
+
0
−
39
View file @
86c60bda
...
...
@@ -268,45 +268,6 @@ class FederationClientTests(HomeserverTestCase):
self
.
assertIsInstance
(
f
.
value
,
TimeoutError
)
def
test_client_requires_trailing_slashes
(
self
):
"""
If a connection is made to a client but the client rejects it due to
requiring a trailing slash. We need to retry the request with a
trailing slash. Workaround for Synapse <=v0.99.2, explained in #3622.
"""
d
=
self
.
cl
.
get_json
(
"
testserv:8008
"
,
"
foo/bar
"
,
try_trailing_slash_on_400
=
True
,
)
self
.
pump
()
# there should have been a call to connectTCP
clients
=
self
.
reactor
.
tcpClients
self
.
assertEqual
(
len
(
clients
),
1
)
(
_host
,
_port
,
factory
,
_timeout
,
_bindAddress
)
=
clients
[
0
]
# complete the connection and wire it up to a fake transport
client
=
factory
.
buildProtocol
(
None
)
conn
=
StringTransport
()
client
.
makeConnection
(
conn
)
# that should have made it send the request to the connection
self
.
assertRegex
(
conn
.
value
(),
b
"
^GET /foo/bar
"
)
# Send the HTTP response
client
.
dataReceived
(
b
"
HTTP/1.1 400 Bad Request
\r\n
"
b
"
Content-Type: application/json
\r\n
"
b
"
Content-Length: 59
\r\n
"
b
"
\r\n
"
b
'
{
"
errcode
"
:
"
M_UNRECOGNIZED
"
,
"
error
"
:
"
Unrecognized request
"
}
'
)
# We should get a successful response
r
=
self
.
successResultOf
(
d
)
self
.
assertEqual
(
r
.
code
,
400
)
self
.
assertEqual
(
r
,
{})
def
test_client_sends_body
(
self
):
self
.
cl
.
post_json
(
"
testserv:8008
"
,
"
foo/bar
"
,
timeout
=
10000
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment