MCPcopy Index your code
hub / github.com/tinode/chat / TestSubscriptionGet

Function TestSubscriptionGet

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

Source from the content-addressed store, hash-verified

523}
524
525func TestSubscriptionGet(t *testing.T) {
526 got, err := adp.SubscriptionGet(testData.Topics[0].Id, types.ParseUserId("usr"+testData.Users[0].Id), false)
527 if err != nil {
528 t.Error(err)
529 }
530
531 if diff := cmp.Diff(got, testData.Subs[0],
532 cmpopts.IgnoreUnexported(types.Subscription{}, types.ObjHeader{})); diff != "" {
533 t.Error(mismatchErrorString("Subs", diff, ""))
534 }
535 // Test not found
536 got, err = adp.SubscriptionGet("dummytopic", dummyUid1, false)
537 if err != nil {
538 t.Error(err)
539 }
540 if got != nil {
541 t.Error("result sub should be nil.")
542 }
543}
544
545func TestSubsForUser(t *testing.T) {
546 gotSubs, err := adp.SubsForUser(types.ParseUserId("usr" + testData.Users[0].Id))

Callers

nothing calls this directly

Calls 4

ParseUserIdFunction · 0.92
ErrorMethod · 0.80
mismatchErrorStringFunction · 0.70
SubscriptionGetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…