MCPcopy
hub / github.com/tinode/chat / TestTopicOwnerChange

Function TestTopicOwnerChange

server/db/postgres/tests/postgres_test.go:883–897  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

881}
882
883func TestTopicOwnerChange(t *testing.T) {
884 err := adp.TopicOwnerChange(testData.Topics[0].Id, types.ParseUserId("usr"+testData.Users[1].Id))
885 if err != nil {
886 t.Fatal(err)
887 }
888 var got int64
889 err = db.QueryRow(ctx, "SELECT owner FROM topics WHERE name=$1", testData.Topics[0].Id).Scan(&got)
890 if err != nil {
891 t.Fatal(err)
892 }
893 expectedOwner := decodeUid(testData.Users[1].Id)
894 if got != expectedOwner {
895 t.Error(mismatchErrorString("Owner", got, expectedOwner))
896 }
897}
898
899func TestSubsUpdate(t *testing.T) {
900 update := map[string]any{

Callers

nothing calls this directly

Calls 6

ParseUserIdFunction · 0.92
ErrorMethod · 0.80
decodeUidFunction · 0.70
mismatchErrorStringFunction · 0.70
TopicOwnerChangeMethod · 0.65
ScanMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…