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

Function TestUserCreate

server/db/rethinkdb/tests/rethink_test.go:57–77  ·  view source on GitHub ↗

================== Create tests ================================

(t *testing.T)

Source from the content-addressed store, hash-verified

55
56// ================== Create tests ================================
57func TestUserCreate(t *testing.T) {
58 for _, user := range testData.Users {
59 if err := adp.UserCreate(user); err != nil {
60 t.Error(err)
61 }
62 }
63
64 cursor, err := rdb.Table("users").Count().Run(conn)
65 if err != nil {
66 t.Error(err)
67 }
68 defer cursor.Close()
69
70 var count int
71 if err = cursor.One(&count); err != nil {
72 t.Error(err)
73 }
74 if count == 0 {
75 t.Error("No users created!")
76 }
77}
78
79func TestCredUpsert(t *testing.T) {
80 // Test just inserts:

Callers

nothing calls this directly

Calls 3

ErrorMethod · 0.80
UserCreateMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…