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

Function TestUserGetByCred

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

Source from the content-addressed store, hash-verified

304}
305
306func TestUserGetByCred(t *testing.T) {
307 // Test not found
308 got, err := adp.UserGetByCred("foo", "bar")
309 if err != nil {
310 t.Fatal(err)
311 }
312 if got != types.ZeroUid {
313 t.Error("result uid should be ZeroUid")
314 }
315
316 got, _ = adp.UserGetByCred(testData.Creds[0].Method, testData.Creds[0].Value)
317 if got != types.ParseUserId("usr"+testData.Creds[0].User) {
318 t.Error(mismatchErrorString("Uid", got, types.ParseUserId("usr"+testData.Creds[0].User)))
319 }
320}
321
322func TestCredGetActive(t *testing.T) {
323 got, err := adp.CredGetActive(types.ParseUserId("usr"+testData.Users[2].Id), "tel")

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…