Skip to content

Commit b5ac281

Browse files
committed
remove the use of SigninUser
1 parent e8627d4 commit b5ac281

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

edgraph/alter_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestDropAllInNs(t *testing.T) {
2525
defer cleanup()
2626

2727
// Drop all data
28-
require.NoError(t, client.SignInUser(context.Background(),
28+
require.NoError(t, client.Login(context.Background(),
2929
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
3030
require.NoError(t, client.DropAllNamespaces(context.Background()))
3131

@@ -55,7 +55,7 @@ func TestDropAllInNs(t *testing.T) {
5555
require.JSONEq(t, `{"q":[{"name":"Alice"}]}`, string(resp.GetJson()))
5656

5757
// namespace 2
58-
require.NoError(t, client.SignInUser(context.Background(),
58+
require.NoError(t, client.Login(context.Background(),
5959
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
6060
require.NoError(t, client.SetSchema(ctx, "ns2", `name: string @index(exact) .`))
6161
require.NoError(t, client.LoginIntoNamespace(context.Background(),
@@ -70,7 +70,7 @@ func TestDropAllInNs(t *testing.T) {
7070
require.JSONEq(t, `{"q":[{"name":"Bob"}]}`, string(resp.GetJson()))
7171

7272
// Drop everything in namespace 1
73-
require.NoError(t, client.SignInUser(context.Background(),
73+
require.NoError(t, client.Login(context.Background(),
7474
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
7575
require.NoError(t, client.Dgraph.DropAll(context.Background(), "ns1"))
7676

@@ -95,13 +95,13 @@ func TestDropAll(t *testing.T) {
9595
defer cleanup()
9696

9797
// Drop all data
98-
require.NoError(t, client.SignInUser(context.Background(),
98+
require.NoError(t, client.Login(context.Background(),
9999
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
100100
require.NoError(t, client.DropAllNamespaces(context.Background()))
101101

102102
// Create two namespaces
103103
ctx := context.Background()
104-
require.NoError(t, client.SignInUser(context.Background(),
104+
require.NoError(t, client.Login(context.Background(),
105105
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
106106
require.NoError(t, client.CreateNamespace(ctx, "ns1"))
107107
require.NoError(t, client.CreateNamespace(ctx, "ns2"))
@@ -127,7 +127,7 @@ func TestDropAll(t *testing.T) {
127127
require.JSONEq(t, `{"q":[{"name":"Alice"}]}`, string(resp.GetJson()))
128128

129129
// namespace 2
130-
require.NoError(t, client.SignInUser(context.Background(),
130+
require.NoError(t, client.Login(context.Background(),
131131
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
132132
require.NoError(t, client.SetSchema(ctx, "ns2", `name: string @index(exact) .`))
133133
require.NoError(t, client.LoginIntoNamespace(context.Background(),
@@ -142,7 +142,7 @@ func TestDropAll(t *testing.T) {
142142
require.JSONEq(t, `{"q":[{"name":"Bob"}]}`, string(resp.GetJson()))
143143

144144
// Drop all data
145-
require.NoError(t, client.SignInUser(context.Background(),
145+
require.NoError(t, client.Login(context.Background(),
146146
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
147147
require.NoError(t, client.DropAllNamespaces(context.Background()))
148148

@@ -162,13 +162,13 @@ func TestDropData(t *testing.T) {
162162
defer cleanup()
163163

164164
// Drop all data
165-
require.NoError(t, client.SignInUser(context.Background(),
165+
require.NoError(t, client.Login(context.Background(),
166166
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
167167
require.NoError(t, client.DropAllNamespaces(context.Background()))
168168

169169
// Create two namespaces
170170
ctx := context.Background()
171-
require.NoError(t, client.SignInUser(context.Background(),
171+
require.NoError(t, client.Login(context.Background(),
172172
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
173173
require.NoError(t, client.CreateNamespace(ctx, "ns1"))
174174
require.NoError(t, client.CreateNamespace(ctx, "ns2"))
@@ -193,7 +193,7 @@ func TestDropData(t *testing.T) {
193193
require.NoError(t, err)
194194
require.JSONEq(t, `{"q":[{"name":"Alice"}]}`, string(resp.GetJson()))
195195

196-
require.NoError(t, client.SignInUser(context.Background(),
196+
require.NoError(t, client.Login(context.Background(),
197197
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
198198
require.NoError(t, client.DropData(context.Background(), "ns1"))
199199

@@ -215,13 +215,13 @@ func TestDropPredicate(t *testing.T) {
215215
defer cleanup()
216216

217217
// Drop all data
218-
require.NoError(t, client.SignInUser(context.Background(),
218+
require.NoError(t, client.Login(context.Background(),
219219
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
220220
require.NoError(t, client.DropAllNamespaces(context.Background()))
221221

222222
// Create two namespaces
223223
ctx := context.Background()
224-
require.NoError(t, client.SignInUser(context.Background(),
224+
require.NoError(t, client.Login(context.Background(),
225225
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
226226
require.NoError(t, client.CreateNamespace(ctx, "ns1"))
227227
require.NoError(t, client.CreateNamespace(ctx, "ns2"))
@@ -246,7 +246,7 @@ func TestDropPredicate(t *testing.T) {
246246
require.NoError(t, err)
247247
require.JSONEq(t, `{"q":[{"name":"Alice"}]}`, string(resp.GetJson()))
248248

249-
require.NoError(t, client.SignInUser(context.Background(),
249+
require.NoError(t, client.Login(context.Background(),
250250
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
251251
require.NoError(t, client.Dgraph.DropPredicate(context.Background(), "ns1", "name"))
252252

@@ -268,13 +268,13 @@ func TestDropType(t *testing.T) {
268268
defer cleanup()
269269

270270
// Drop all data
271-
require.NoError(t, client.SignInUser(context.Background(),
271+
require.NoError(t, client.Login(context.Background(),
272272
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
273273
require.NoError(t, client.DropAllNamespaces(context.Background()))
274274

275275
// Create two namespaces
276276
ctx := context.Background()
277-
require.NoError(t, client.SignInUser(context.Background(),
277+
require.NoError(t, client.Login(context.Background(),
278278
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
279279
require.NoError(t, client.CreateNamespace(ctx, "ns1"))
280280
require.NoError(t, client.CreateNamespace(ctx, "ns2"))
@@ -303,7 +303,7 @@ func TestDropType(t *testing.T) {
303303
require.NoError(t, err)
304304
require.Contains(t, string(resp.GetJson()), `"name":"name"`)
305305

306-
require.NoError(t, client.SignInUser(context.Background(),
306+
require.NoError(t, client.Login(context.Background(),
307307
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
308308
require.NoError(t, client.DropType(context.Background(), "ns1", "Person"))
309309
resp, err = client.Query(`schema{}`)

edgraph/namespace_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestNamespaces(t *testing.T) {
2626
defer cleanup()
2727

2828
// Drop all data
29-
require.NoError(t, client.SignInUser(context.Background(),
29+
require.NoError(t, client.Login(context.Background(),
3030
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
3131
require.NoError(t, client.DropAll())
3232

@@ -91,7 +91,7 @@ func TestNamespacesPreV25(t *testing.T) {
9191
dgraphapi.DefaultPassword, x.GalaxyNamespace))
9292

9393
// Drop all data
94-
require.NoError(t, client.SignInUser(context.Background(),
94+
require.NoError(t, client.Login(context.Background(),
9595
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
9696
require.NoError(t, client.DropAll())
9797

@@ -158,7 +158,7 @@ func TestCreateNamespaceErr(t *testing.T) {
158158
defer cleanup()
159159

160160
// Drop all data
161-
require.NoError(t, client.SignInUser(context.Background(),
161+
require.NoError(t, client.Login(context.Background(),
162162
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
163163
require.NoError(t, client.DropAll())
164164

@@ -200,7 +200,7 @@ func TestDropNamespaceErr(t *testing.T) {
200200
defer cleanup()
201201

202202
// Drop all data
203-
require.NoError(t, client.SignInUser(context.Background(),
203+
require.NoError(t, client.Login(context.Background(),
204204
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
205205
require.NoError(t, client.DropAll())
206206

@@ -250,7 +250,7 @@ func TestRenameNamespaceErr(t *testing.T) {
250250
defer cleanup()
251251

252252
// Drop all data
253-
require.NoError(t, client.SignInUser(context.Background(),
253+
require.NoError(t, client.Login(context.Background(),
254254
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
255255
require.NoError(t, client.DropAll())
256256

@@ -294,7 +294,7 @@ func TestListNamespacesErr(t *testing.T) {
294294
defer cleanup()
295295

296296
// Drop all data
297-
require.NoError(t, client.SignInUser(context.Background(),
297+
require.NoError(t, client.Login(context.Background(),
298298
dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
299299
require.NoError(t, client.DropAll())
300300

0 commit comments

Comments
 (0)