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

Function TestCredGetActive

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

Source from the content-addressed store, hash-verified

320}
321
322func TestCredGetActive(t *testing.T) {
323 got, err := adp.CredGetActive(types.ParseUserId("usr"+testData.Users[2].Id), "tel")
324 if err != nil {
325 t.Error(err)
326 }
327 if !reflect.DeepEqual(got, testData.Creds[3]) {
328 t.Error(mismatchErrorString("Credential", got, testData.Creds[3]))
329 }
330
331 // Test not found
332 got, err = adp.CredGetActive(dummyUid1, "")
333 if err != nil {
334 t.Error(err)
335 }
336 if got != nil {
337 t.Error("result should be nil, but got", got)
338 }
339}
340
341func TestCredGetAll(t *testing.T) {
342 got, err := adp.CredGetAll(types.ParseUserId("usr"+testData.Users[2].Id), "", false)

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…