Add URL check in test

This commit is contained in:
Neil Alexander 2020-06-16 11:32:49 +01:00
parent cd19f85175
commit 01f944218d

View file

@ -107,6 +107,12 @@ func (m *MockRoundTripper) RoundTrip(req *http.Request) (res *http.Response, err
return nil, fmt.Errorf("server not known: %s", req.Host) return nil, fmt.Errorf("server not known: %s", req.Host)
} }
// We're intercepting /matrix/key/v2/server requests here, so check
// that the URL supplied in the request is for that.
if req.URL.Path != "/_matrix/key/v2/server" {
return nil, fmt.Errorf("unexpected request path: %s", req.URL.Path)
}
// Query the local keys for the server in question. // Query the local keys for the server in question.
request := &api.QueryLocalKeysRequest{} request := &api.QueryLocalKeysRequest{}
response := &api.QueryLocalKeysResponse{} response := &api.QueryLocalKeysResponse{}