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

Function TestAuthAddRecord

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

Source from the content-addressed store, hash-verified

123}
124
125func TestAuthAddRecord(t *testing.T) {
126 for _, rec := range testData.Recs {
127 err := adp.AuthAddRecord(types.ParseUserId("usr"+rec.UserId), rec.Scheme, rec.Unique,
128 rec.AuthLvl, rec.Secret, rec.Expires)
129 if err != nil {
130 t.Fatal(err)
131 }
132 }
133 //Test duplicate
134 err := adp.AuthAddRecord(types.ParseUserId("usr"+testData.Users[0].Id), testData.Recs[0].Scheme,
135 testData.Recs[0].Unique, testData.Recs[0].AuthLvl, testData.Recs[0].Secret, testData.Recs[0].Expires)
136 if err != types.ErrDuplicate {
137 t.Fatal("Should be duplicate error but got", err)
138 }
139}
140
141func TestTopicCreate(t *testing.T) {
142 err := adp.TopicCreate(testData.Topics[0])

Callers

nothing calls this directly

Calls 2

ParseUserIdFunction · 0.92
AuthAddRecordMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…