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

Function TestTopicGet

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

Source from the content-addressed store, hash-verified

408}
409
410func TestTopicGet(t *testing.T) {
411 got, err := adp.TopicGet(testData.Topics[0].Id)
412 if err != nil {
413 t.Fatal(err)
414 }
415 if !reflect.DeepEqual(got, testData.Topics[0]) {
416 t.Error(mismatchErrorString("Topic", got, testData.Topics[0]))
417 }
418 // Test not found
419 got, err = adp.TopicGet("asdfasdfasdf")
420 if err != nil {
421 t.Fatal(err)
422 }
423 if got != nil {
424 t.Error("Topic should be nil but got:", got)
425 }
426}
427
428func TestTopicsForUser(t *testing.T) {
429 qOpts := types.QueryOpt{

Callers

nothing calls this directly

Calls 3

ErrorMethod · 0.80
mismatchErrorStringFunction · 0.70
TopicGetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…