@@ -324,9 +324,7 @@ func orgsCountByUser(t *testing.T, ctx context.Context, db *organizations) {
324
324
assert .Equal (t , int64 (0 ), got )
325
325
}
326
326
327
- func orgsCount (t * testing.T , db * organizations ) {
328
- ctx := context .Background ()
329
-
327
+ func orgsCount (t * testing.T , ctx context.Context , db * organizations ) {
330
328
// Has no organization initially
331
329
got := db .Count (ctx )
332
330
assert .Equal (t , int64 (0 ), got )
@@ -344,9 +342,7 @@ func orgsCount(t *testing.T, db *organizations) {
344
342
assert .Equal (t , int64 (1 ), got )
345
343
}
346
344
347
- func orgsDeleteByID (t * testing.T , db * organizations ) {
348
- ctx := context .Background ()
349
-
345
+ func orgsDeleteByID (t * testing.T , ctx context.Context , db * organizations ) {
350
346
tempPictureAvatarUploadPath := filepath .Join (os .TempDir (), "orgsDeleteByID-tempPictureAvatarUploadPath" )
351
347
conf .SetMockPicture (t , conf.PictureOpts {AvatarUploadPath : tempPictureAvatarUploadPath })
352
348
@@ -407,9 +403,7 @@ func orgsDeleteByID(t *testing.T, db *organizations) {
407
403
assert .Equal (t , wantErr , err )
408
404
}
409
405
410
- func orgsAddMember (t * testing.T , db * organizations ) {
411
- ctx := context .Background ()
412
-
406
+ func orgsAddMember (t * testing.T , ctx context.Context , db * organizations ) {
413
407
usersStore := NewUsersStore (db .DB )
414
408
alice , err := usersStore .Create (ctx , "alice" , "alice@example.com" , CreateUserOptions {})
415
409
require .NoError (t , err )
@@ -446,9 +440,7 @@ func orgsAddMember(t *testing.T, db *organizations) {
446
440
assert .Equal (t , 2 , gotOrg .NumMembers )
447
441
}
448
442
449
- func orgsRemoveMember (t * testing.T , db * organizations ) {
450
- ctx := context .Background ()
451
-
443
+ func orgsRemoveMember (t * testing.T , ctx context.Context , db * organizations ) {
452
444
usersStore := NewUsersStore (db .DB )
453
445
alice , err := usersStore .Create (ctx , "alice" , "alice@example.com" , CreateUserOptions {})
454
446
require .NoError (t , err )
@@ -560,9 +552,7 @@ func orgsRemoveMember(t *testing.T, db *organizations) {
560
552
assert .Equal (t , 1 , gotOrg .NumMembers )
561
553
}
562
554
563
- func orgsHasMember (t * testing.T , db * organizations ) {
564
- ctx := context .Background ()
565
-
555
+ func orgsHasMember (t * testing.T , ctx context.Context , db * organizations ) {
566
556
got , _ := db .HasMember (ctx , 1 , 1 )
567
557
assert .False (t , got )
568
558
@@ -573,9 +563,7 @@ func orgsHasMember(t *testing.T, db *organizations) {
573
563
assert .True (t , got )
574
564
}
575
565
576
- func orgsListMembers (t * testing.T , db * organizations ) {
577
- ctx := context .Background ()
578
-
566
+ func orgsListMembers (t * testing.T , ctx context.Context , db * organizations ) {
579
567
usersStore := NewUsersStore (db .DB )
580
568
alice , err := usersStore .Create (ctx , "alice" , "alice@example.com" , CreateUserOptions {})
581
569
require .NoError (t , err )
@@ -602,9 +590,7 @@ func orgsListMembers(t *testing.T, db *organizations) {
602
590
assert .Equal (t , bob .ID , got [1 ].ID )
603
591
}
604
592
605
- func orgsIsOwnedBy (t * testing.T , db * organizations ) {
606
- ctx := context .Background ()
607
-
593
+ func orgsIsOwnedBy (t * testing.T , ctx context.Context , db * organizations ) {
608
594
usersStore := NewUsersStore (db .DB )
609
595
alice , err := usersStore .Create (ctx , "alice" , "alice@example.com" , CreateUserOptions {})
610
596
require .NoError (t , err )
@@ -629,9 +615,7 @@ func orgsIsOwnedBy(t *testing.T, db *organizations) {
629
615
assert .False (t , got )
630
616
}
631
617
632
- func orgsSetMemberVisibility (t * testing.T , db * organizations ) {
633
- ctx := context .Background ()
634
-
618
+ func orgsSetMemberVisibility (t * testing.T , ctx context.Context , db * organizations ) {
635
619
usersStore := NewUsersStore (db .DB )
636
620
alice , err := usersStore .Create (ctx , "alice" , "alice@example.com" , CreateUserOptions {})
637
621
require .NoError (t , err )
@@ -653,9 +637,7 @@ func orgsSetMemberVisibility(t *testing.T, db *organizations) {
653
637
assert .Len (t , got , 1 )
654
638
}
655
639
656
- func orgsGetTeamByName (t * testing.T , db * organizations ) {
657
- ctx := context .Background ()
658
-
640
+ func orgsGetTeamByName (t * testing.T , ctx context.Context , db * organizations ) {
659
641
usersStore := NewUsersStore (db .DB )
660
642
alice , err := usersStore .Create (ctx , "alice" , "alice@example.com" , CreateUserOptions {})
661
643
require .NoError (t , err )
@@ -695,10 +677,10 @@ func orgsGetTeamByName(t *testing.T, db *organizations) {
695
677
require .NoError (t , err )
696
678
}
697
679
698
- func orgsAccessibleRepositoriesByUser (t * testing.T , db * organizations ) {
680
+ func orgsAccessibleRepositoriesByUser (t * testing.T , ctx context. Context , db * organizations ) {
699
681
// todo
700
682
}
701
683
702
- func orgsMirrorRepositoriesByUser (t * testing.T , db * organizations ) {
684
+ func orgsMirrorRepositoriesByUser (t * testing.T , ctx context. Context , db * organizations ) {
703
685
// todo
704
686
}
0 commit comments