mirror of
https://github.com/element-hq/dendrite.git
synced 2025-03-14 14:15:35 +00:00
msc3861: tests
This commit is contained in:
parent
c490badadc
commit
1b8a659eca
1 changed files with 0 additions and 22 deletions
|
@ -24,7 +24,6 @@ import (
|
|||
type mockKeyAPI struct {
|
||||
t *testing.T
|
||||
queryKeysData map[string]api.QueryKeysResponse
|
||||
queryMasterKeysData map[string]api.QueryMasterKeysResponse
|
||||
}
|
||||
|
||||
func (m mockKeyAPI) QueryKeys(ctx context.Context, req *api.QueryKeysRequest, res *api.QueryKeysResponse) {
|
||||
|
@ -36,14 +35,6 @@ func (m mockKeyAPI) QueryKeys(ctx context.Context, req *api.QueryKeysRequest, re
|
|||
}
|
||||
}
|
||||
|
||||
func (m mockKeyAPI) QueryMasterKeys(ctx context.Context, req *api.QueryMasterKeysRequest, res *api.QueryMasterKeysResponse) {
|
||||
res.Key = m.queryMasterKeysData[req.UserID].Key
|
||||
res.Error = m.queryMasterKeysData[req.UserID].Error
|
||||
if m.t != nil {
|
||||
m.t.Logf("QueryMasterKeys: %+v => %+v", req, res)
|
||||
}
|
||||
}
|
||||
|
||||
func (m mockKeyAPI) PerformUploadDeviceKeys(ctx context.Context, req *api.PerformUploadDeviceKeysRequest, res *api.PerformUploadDeviceKeysResponse) {
|
||||
// Just a dummy upload which always succeeds
|
||||
}
|
||||
|
@ -67,9 +58,6 @@ func Test_UploadCrossSigningDeviceKeys_ValidRequest(t *testing.T) {
|
|||
queryKeysData: map[string]api.QueryKeysResponse{
|
||||
"@user:example.com": {},
|
||||
},
|
||||
queryMasterKeysData: map[string]api.QueryMasterKeysResponse{
|
||||
"@user:example.com": {},
|
||||
},
|
||||
}
|
||||
device := &api.Device{UserID: "@user:example.com", ID: "device"}
|
||||
cfg := &config.ClientAPI{
|
||||
|
@ -130,11 +118,6 @@ func Test_UploadCrossSigningDeviceKeys_Unauthorised(t *testing.T) {
|
|||
UserSigningKeys: nil,
|
||||
},
|
||||
},
|
||||
queryMasterKeysData: map[string]api.QueryMasterKeysResponse{
|
||||
"@user:example.com": {
|
||||
Key: spec.Base64Bytes("key1"),
|
||||
},
|
||||
},
|
||||
}
|
||||
device := &api.Device{UserID: "@user:example.com", ID: "device"}
|
||||
cfg := &config.ClientAPI{
|
||||
|
@ -194,11 +177,6 @@ func Test_UploadCrossSigningDeviceKeys_ExistingKeysMismatch(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
queryMasterKeysData: map[string]api.QueryMasterKeysResponse{
|
||||
"@user:example.com": {
|
||||
Key: spec.Base64Bytes("different_key"),
|
||||
},
|
||||
},
|
||||
}
|
||||
device := &api.Device{UserID: "@user:example.com", ID: "device"}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue