Update test to match reality

This commit is contained in:
Kegan Dougal 2020-09-15 17:59:09 +01:00
parent d9acb07326
commit 19fede75a9

View file

@ -461,7 +461,8 @@ func TestBasicTransaction(t *testing.T) {
assertInputRoomEvents(t, rsAPI.inputRoomEvents, []gomatrixserverlib.HeaderedEvent{testEvents[len(testEvents)-1]}) assertInputRoomEvents(t, rsAPI.inputRoomEvents, []gomatrixserverlib.HeaderedEvent{testEvents[len(testEvents)-1]})
} }
// The purpose of this test is to check that if the event received fails auth checks the transaction is failed. // The purpose of this test is to check that if the event received fails auth checks the event is still sent to the roomserver
// as it does the auth check.
func TestTransactionFailAuthChecks(t *testing.T) { func TestTransactionFailAuthChecks(t *testing.T) {
rsAPI := &testRoomserverAPI{ rsAPI := &testRoomserverAPI{
queryStateAfterEvents: func(req *api.QueryStateAfterEventsRequest) api.QueryStateAfterEventsResponse { queryStateAfterEvents: func(req *api.QueryStateAfterEventsRequest) api.QueryStateAfterEventsResponse {
@ -479,11 +480,9 @@ func TestTransactionFailAuthChecks(t *testing.T) {
testData[len(testData)-1], // a message event testData[len(testData)-1], // a message event
} }
txn := mustCreateTransaction(rsAPI, &txnFedClient{}, pdus) txn := mustCreateTransaction(rsAPI, &txnFedClient{}, pdus)
mustProcessTransaction(t, txn, []string{ mustProcessTransaction(t, txn, []string{})
// expect the event to have an error // expect message to be sent to the roomserver
testEvents[len(testEvents)-1].EventID(), assertInputRoomEvents(t, rsAPI.inputRoomEvents, []gomatrixserverlib.HeaderedEvent{testEvents[len(testEvents)-1]})
})
assertInputRoomEvents(t, rsAPI.inputRoomEvents, nil) // expect no messages to be sent to the roomserver
} }
// The purpose of this test is to make sure that when an event is received for which we do not know the prev_events, // The purpose of this test is to make sure that when an event is received for which we do not know the prev_events,