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

Function TestAuthAddRecord

server/db/mongodb/tests/mongo_test.go:119–133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

117}
118
119func TestAuthAddRecord(t *testing.T) {
120 for _, rec := range testData.Recs {
121 err := adp.AuthAddRecord(types.ParseUserId("usr"+rec.UserId), rec.Scheme, rec.Unique,
122 rec.AuthLvl, rec.Secret, rec.Expires)
123 if err != nil {
124 t.Fatal(err)
125 }
126 }
127 //Test duplicate
128 err := adp.AuthAddRecord(types.ParseUserId("usr"+testData.Users[0].Id), testData.Recs[0].Scheme,
129 testData.Recs[0].Unique, testData.Recs[0].AuthLvl, testData.Recs[0].Secret, testData.Recs[0].Expires)
130 if err != types.ErrDuplicate {
131 t.Fatal("Should be duplicate error but got", err)
132 }
133}
134
135func TestTopicCreate(t *testing.T) {
136 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…