@@ -48,7 +48,9 @@ func TestBox_Sugar_Info(t *testing.T) {
4848 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
4949 require .NoError (t , err )
5050
51- info , err := box .New (conn ).Info ()
51+ b := box .MustNew (conn )
52+
53+ info , err := b .Info ()
5254 require .NoError (t , err )
5355
5456 validateInfo (t , info )
@@ -83,7 +85,7 @@ func TestBox_Sugar_Schema_UserCreate_NoError(t *testing.T) {
8385 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
8486 require .NoError (t , err )
8587
86- b := box .New (conn )
88+ b := box .MustNew (conn )
8789
8890 // Create new user.
8991 err = b .Schema ().User ().Create (ctx , username , box.UserCreateOptions {Password : password })
@@ -103,7 +105,7 @@ func TestBox_Sugar_Schema_UserCreate_CanConnectWithNewCred(t *testing.T) {
103105 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
104106 require .NoError (t , err )
105107
106- b := box .New (conn )
108+ b := box .MustNew (conn )
107109
108110 // Create new user.
109111 err = b .Schema ().User ().Create (ctx , username , box.UserCreateOptions {Password : password })
@@ -137,7 +139,7 @@ func TestBox_Sugar_Schema_UserCreate_AlreadyExists(t *testing.T) {
137139 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
138140 require .NoError (t , err )
139141
140- b := box .New (conn )
142+ b := box .MustNew (conn )
141143
142144 // Create new user.
143145 err = b .Schema ().User ().Create (ctx , username , box.UserCreateOptions {Password : password })
@@ -167,7 +169,7 @@ func TestBox_Sugar_Schema_UserCreate_ExistsTrue(t *testing.T) {
167169 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
168170 require .NoError (t , err )
169171
170- b := box .New (conn )
172+ b := box .MustNew (conn )
171173
172174 // Create new user.
173175 err = b .Schema ().User ().Create (ctx , username , box.UserCreateOptions {Password : password })
@@ -193,7 +195,7 @@ func TestBox_Sugar_Schema_UserCreate_IfNotExistsNoErr(t *testing.T) {
193195 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
194196 require .NoError (t , err )
195197
196- b := box .New (conn )
198+ b := box .MustNew (conn )
197199
198200 // Create new user.
199201 err = b .Schema ().User ().Create (ctx , username , box.UserCreateOptions {Password : password })
@@ -217,7 +219,7 @@ func TestBox_Sugar_Schema_UserPassword(t *testing.T) {
217219 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
218220 require .NoError (t , err )
219221
220- b := box .New (conn )
222+ b := box .MustNew (conn )
221223
222224 // Require password hash.
223225 hash , err := b .Schema ().User ().Password (ctx , password )
@@ -236,7 +238,7 @@ func TestBox_Sugar_Schema_UserDrop_AfterCreate(t *testing.T) {
236238 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
237239 require .NoError (t , err )
238240
239- b := box .New (conn )
241+ b := box .MustNew (conn )
240242
241243 // Create new user
242244 err = b .Schema ().User ().Create (ctx , username , box.UserCreateOptions {Password : password })
@@ -258,7 +260,7 @@ func TestBox_Sugar_Schema_UserDrop_DoubleDrop(t *testing.T) {
258260 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
259261 require .NoError (t , err )
260262
261- b := box .New (conn )
263+ b := box .MustNew (conn )
262264
263265 // Create new user
264266 err = b .Schema ().User ().Create (ctx , username , box.UserCreateOptions {Password : password })
@@ -286,7 +288,7 @@ func TestBox_Sugar_Schema_UserDrop_UnknownUser(t *testing.T) {
286288 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
287289 require .NoError (t , err )
288290
289- b := box .New (conn )
291+ b := box .MustNew (conn )
290292
291293 // Require error cause user not exists
292294 err = b .Schema ().User ().Drop (ctx , "some_strange_not_existing_name" , box.UserDropOptions {})
@@ -305,7 +307,7 @@ func TestSchemaUser_Passwd_NotFound(t *testing.T) {
305307 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
306308 require .NoError (t , err )
307309
308- b := box .New (conn )
310+ b := box .MustNew (conn )
309311
310312 err = b .Schema ().User ().Passwd (ctx , "not-exists-passwd" , "new_password" )
311313 require .Error (t , err )
@@ -329,7 +331,7 @@ func TestSchemaUser_Passwd_Ok(t *testing.T) {
329331 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
330332 require .NoError (t , err )
331333
332- b := box .New (conn )
334+ b := box .MustNew (conn )
333335
334336 // New user change password and connect
335337
@@ -367,7 +369,7 @@ func TestSchemaUser_Passwd_WithoutGrants(t *testing.T) {
367369 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
368370 require .NoError (t , err )
369371
370- b := box .New (conn )
372+ b := box .MustNew (conn )
371373
372374 err = b .Schema ().User ().Create (ctx , username ,
373375 box.UserCreateOptions {Password : startPassword , IfNotExists : true })
@@ -381,7 +383,8 @@ func TestSchemaUser_Passwd_WithoutGrants(t *testing.T) {
381383 require .NoError (t , err )
382384 require .NotNil (t , conn2Fail )
383385
384- bFail := box .New (conn2Fail )
386+ bFail := box .MustNew (conn2Fail )
387+
385388 // can't change self user password without grants
386389 err = bFail .Schema ().User ().Passwd (ctx , endPassword )
387390 require .Error (t , err )
@@ -401,7 +404,7 @@ func TestSchemaUser_Info_TestUserCorrect(t *testing.T) {
401404 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
402405 require .NoError (t , err )
403406
404- b := box .New (conn )
407+ b := box .MustNew (conn )
405408
406409 privileges , err := b .Schema ().User ().Info (ctx , dialer .User )
407410 require .NoError (t , err )
@@ -418,7 +421,7 @@ func TestSchemaUser_Info_NonExistsUser(t *testing.T) {
418421 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
419422 require .NoError (t , err )
420423
421- b := box .New (conn )
424+ b := box .MustNew (conn )
422425
423426 privileges , err := b .Schema ().User ().Info (ctx , "non-existing" )
424427 require .Error (t , err )
@@ -438,7 +441,7 @@ func TestBox_Sugar_Schema_UserGrant_NoSu(t *testing.T) {
438441 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
439442 require .NoError (t , err )
440443
441- b := box .New (conn )
444+ b := box .MustNew (conn )
442445
443446 err = b .Schema ().User ().Create (ctx , username , box.UserCreateOptions {Password : password })
444447 require .NoError (t , err )
@@ -471,7 +474,7 @@ func TestBox_Sugar_Schema_UserGrant_WithSu(t *testing.T) {
471474 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
472475 require .NoError (t , err )
473476
474- b := box .New (conn )
477+ b := box .MustNew (conn )
475478
476479 err = b .Schema ().User ().Create (ctx , username , box.UserCreateOptions {Password : password })
477480 require .NoError (t , err )
@@ -521,7 +524,7 @@ func TestSchemaUser_Revoke_WithoutSu(t *testing.T) {
521524 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
522525 require .NoError (t , err )
523526
524- b := box .New (conn )
527+ b := box .MustNew (conn )
525528
526529 err = b .Schema ().User ().Create (ctx , username , box.UserCreateOptions {Password : password })
527530 require .NoError (t , err )
@@ -555,7 +558,7 @@ func TestSchemaUser_Revoke_WithSu(t *testing.T) {
555558 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
556559 require .NoError (t , err )
557560
558- b := box .New (conn )
561+ b := box .MustNew (conn )
559562
560563 err = b .Schema ().User ().Create (ctx , username , box.UserCreateOptions {Password : password })
561564 require .NoError (t , err )
@@ -603,7 +606,7 @@ func TestSchemaUser_Revoke_NonExistsPermission(t *testing.T) {
603606 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
604607 require .NoError (t , err )
605608
606- b := box .New (conn )
609+ b := box .MustNew (conn )
607610
608611 err = b .Schema ().User ().Create (ctx , username , box.UserCreateOptions {Password : password })
609612 require .NoError (t , err )
@@ -639,7 +642,7 @@ func TestSession_Su_AdminPermissions(t *testing.T) {
639642 conn , err := tarantool .Connect (ctx , dialer , tarantool.Opts {})
640643 require .NoError (t , err )
641644
642- b := box .New (conn )
645+ b := box .MustNew (conn )
643646
644647 err = b .Session ().Su (ctx , "admin" )
645648 require .NoError (t , err )
@@ -652,7 +655,8 @@ func cleanupUser(username string) {
652655 log .Fatal (err )
653656 }
654657
655- b := box .New (conn )
658+ b := box .MustNew (conn )
659+
656660 err = b .Schema ().User ().Drop (ctx , username , box.UserDropOptions {})
657661 if err != nil {
658662 log .Fatal (err )
0 commit comments