MCPcopy Create free account
hub / github.com/daodst/chat / TestBasicTransaction

Function TestBasicTransaction

federationapi/routing/send_test.go:259–267  ·  view source on GitHub ↗

The purpose of this test is to check that receiving an event over federation for which we have the prev_events works correctly, and passes it on to the roomserver. It's the most basic test possible.

(t *testing.T)

Source from the content-addressed store, hash-verified

257// The purpose of this test is to check that receiving an event over federation for which we have the prev_events works correctly, and passes it on
258// to the roomserver. It's the most basic test possible.
259func TestBasicTransaction(t *testing.T) {
260 rsAPI := &testRoomserverAPI{}
261 pdus := []json.RawMessage{
262 testData[len(testData)-1], // a message event
263 }
264 txn := mustCreateTransaction(rsAPI, &txnFedClient{}, pdus)
265 mustProcessTransaction(t, txn, nil)
266 assertInputRoomEvents(t, rsAPI.inputRoomEvents, []*gomatrixserverlib.HeaderedEvent{testEvents[len(testEvents)-1]})
267}
268
269// The purpose of this test is to check that if the event received fails auth checks the event is still sent to the roomserver
270// as it does the auth check.

Callers

nothing calls this directly

Calls 3

mustCreateTransactionFunction · 0.85
mustProcessTransactionFunction · 0.85
assertInputRoomEventsFunction · 0.85

Tested by

no test coverage detected