@@ -533,15 +533,15 @@ func TestActionsService_ListEnvVariables(t *testing.T) {
533533 client , mux , _ , teardown := setup ()
534534 defer teardown ()
535535
536- mux .HandleFunc ("/repositories /1/environments/e/variables" , func (w http.ResponseWriter , r * http.Request ) {
536+ mux .HandleFunc ("/repos/usr /1/environments/e/variables" , func (w http.ResponseWriter , r * http.Request ) {
537537 testMethod (t , r , "GET" )
538538 testFormValues (t , r , values {"per_page" : "2" , "page" : "2" })
539539 fmt .Fprint (w , `{"total_count":4,"variables":[{"name":"A","value":"AA","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"},{"name":"B","value":"BB","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}]}` )
540540 })
541541
542542 opts := & ListOptions {Page : 2 , PerPage : 2 }
543543 ctx := context .Background ()
544- variables , _ , err := client .Actions .ListEnvVariables (ctx , 1 , "e" , opts )
544+ variables , _ , err := client .Actions .ListEnvVariables (ctx , "usr" , "1" , "e" , opts )
545545 if err != nil {
546546 t .Errorf ("Actions.ListEnvVariables returned error: %v" , err )
547547 }
@@ -559,12 +559,12 @@ func TestActionsService_ListEnvVariables(t *testing.T) {
559559
560560 const methodName = "ListEnvVariables"
561561 testBadOptions (t , methodName , func () (err error ) {
562- _ , _ , err = client .Actions .ListEnvVariables (ctx , 0.0 , "\n " , opts )
562+ _ , _ , err = client .Actions .ListEnvVariables (ctx , "usr" , "0" , "\n " , opts )
563563 return err
564564 })
565565
566566 testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
567- got , resp , err := client .Actions .ListEnvVariables (ctx , 1 , "e" , opts )
567+ got , resp , err := client .Actions .ListEnvVariables (ctx , "usr" , "1" , "e" , opts )
568568 if got != nil {
569569 t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
570570 }
@@ -576,13 +576,13 @@ func TestActionsService_GetEnvVariable(t *testing.T) {
576576 client , mux , _ , teardown := setup ()
577577 defer teardown ()
578578
579- mux .HandleFunc ("/repositories /1/environments/e/variables/variable" , func (w http.ResponseWriter , r * http.Request ) {
579+ mux .HandleFunc ("/repos/usr /1/environments/e/variables/variable" , func (w http.ResponseWriter , r * http.Request ) {
580580 testMethod (t , r , "GET" )
581581 fmt .Fprint (w , `{"name":"variable","value":"VAR","created_at":"2019-01-02T15:04:05Z","updated_at":"2020-01-02T15:04:05Z"}` )
582582 })
583583
584584 ctx := context .Background ()
585- variable , _ , err := client .Actions .GetEnvVariable (ctx , 1 , "e" , "variable" )
585+ variable , _ , err := client .Actions .GetEnvVariable (ctx , "usr" , "1" , "e" , "variable" )
586586 if err != nil {
587587 t .Errorf ("Actions.GetEnvVariable returned error: %v" , err )
588588 }
@@ -599,12 +599,12 @@ func TestActionsService_GetEnvVariable(t *testing.T) {
599599
600600 const methodName = "GetEnvVariable"
601601 testBadOptions (t , methodName , func () (err error ) {
602- _ , _ , err = client .Actions .GetEnvVariable (ctx , 0.0 , "\n " , "\n " )
602+ _ , _ , err = client .Actions .GetEnvVariable (ctx , "usr" , "0" , "\n " , "\n " )
603603 return err
604604 })
605605
606606 testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
607- got , resp , err := client .Actions .GetEnvVariable (ctx , 1 , "e" , "variable" )
607+ got , resp , err := client .Actions .GetEnvVariable (ctx , "usr" , "1" , "e" , "variable" )
608608 if got != nil {
609609 t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
610610 }
@@ -616,7 +616,7 @@ func TestActionsService_CreateEnvVariable(t *testing.T) {
616616 client , mux , _ , teardown := setup ()
617617 defer teardown ()
618618
619- mux .HandleFunc ("/repositories /1/environments/e/variables" , func (w http.ResponseWriter , r * http.Request ) {
619+ mux .HandleFunc ("/repos/usr /1/environments/e/variables" , func (w http.ResponseWriter , r * http.Request ) {
620620 testMethod (t , r , "POST" )
621621 testHeader (t , r , "Content-Type" , "application/json" )
622622 testBody (t , r , `{"name":"variable","value":"VAR"}` + "\n " )
@@ -628,27 +628,27 @@ func TestActionsService_CreateEnvVariable(t *testing.T) {
628628 Value : "VAR" ,
629629 }
630630 ctx := context .Background ()
631- _ , err := client .Actions .CreateEnvVariable (ctx , 1 , "e" , input )
631+ _ , err := client .Actions .CreateEnvVariable (ctx , "usr" , "1" , "e" , input )
632632 if err != nil {
633633 t .Errorf ("Actions.CreateEnvVariable returned error: %v" , err )
634634 }
635635
636636 const methodName = "CreateEnvVariable"
637637 testBadOptions (t , methodName , func () (err error ) {
638- _ , err = client .Actions .CreateEnvVariable (ctx , 0.0 , "\n " , input )
638+ _ , err = client .Actions .CreateEnvVariable (ctx , "usr" , "0" , "\n " , input )
639639 return err
640640 })
641641
642642 testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
643- return client .Actions .CreateEnvVariable (ctx , 1 , "e" , input )
643+ return client .Actions .CreateEnvVariable (ctx , "usr" , "1" , "e" , input )
644644 })
645645}
646646
647647func TestActionsService_UpdateEnvVariable (t * testing.T ) {
648648 client , mux , _ , teardown := setup ()
649649 defer teardown ()
650650
651- mux .HandleFunc ("/repositories /1/environments/e/variables/variable" , func (w http.ResponseWriter , r * http.Request ) {
651+ mux .HandleFunc ("/repos/usr /1/environments/e/variables/variable" , func (w http.ResponseWriter , r * http.Request ) {
652652 testMethod (t , r , "PATCH" )
653653 testHeader (t , r , "Content-Type" , "application/json" )
654654 testBody (t , r , `{"name":"variable","value":"VAR"}` + "\n " )
@@ -660,44 +660,44 @@ func TestActionsService_UpdateEnvVariable(t *testing.T) {
660660 Value : "VAR" ,
661661 }
662662 ctx := context .Background ()
663- _ , err := client .Actions .UpdateEnvVariable (ctx , 1 , "e" , input )
663+ _ , err := client .Actions .UpdateEnvVariable (ctx , "usr" , "1" , "e" , input )
664664 if err != nil {
665665 t .Errorf ("Actions.UpdateEnvVariable returned error: %v" , err )
666666 }
667667
668668 const methodName = "UpdateEnvVariable"
669669 testBadOptions (t , methodName , func () (err error ) {
670- _ , err = client .Actions .UpdateEnvVariable (ctx , 0.0 , "\n " , input )
670+ _ , err = client .Actions .UpdateEnvVariable (ctx , "usr" , "1" , "\n " , input )
671671 return err
672672 })
673673
674674 testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
675- return client .Actions .UpdateEnvVariable (ctx , 1 , "e" , input )
675+ return client .Actions .UpdateEnvVariable (ctx , "usr" , "1" , "e" , input )
676676 })
677677}
678678
679679func TestActionsService_DeleteEnvVariable (t * testing.T ) {
680680 client , mux , _ , teardown := setup ()
681681 defer teardown ()
682682
683- mux .HandleFunc ("/repositories /1/environments/e/variables/variable" , func (w http.ResponseWriter , r * http.Request ) {
683+ mux .HandleFunc ("/repos/usr /1/environments/e/variables/variable" , func (w http.ResponseWriter , r * http.Request ) {
684684 testMethod (t , r , "DELETE" )
685685 })
686686
687687 ctx := context .Background ()
688- _ , err := client .Actions .DeleteEnvVariable (ctx , 1 , "e" , "variable" )
688+ _ , err := client .Actions .DeleteEnvVariable (ctx , "usr" , "1" , "e" , "variable" )
689689 if err != nil {
690690 t .Errorf ("Actions.DeleteEnvVariable returned error: %v" , err )
691691 }
692692
693693 const methodName = "DeleteEnvVariable"
694694 testBadOptions (t , methodName , func () (err error ) {
695- _ , err = client .Actions .DeleteEnvVariable (ctx , 0.0 , "\n " , "\n " )
695+ _ , err = client .Actions .DeleteEnvVariable (ctx , "usr" , "0" , "\n " , "\n " )
696696 return err
697697 })
698698
699699 testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
700- return client .Actions .DeleteEnvVariable (ctx , 1 , "r" , "variable" )
700+ return client .Actions .DeleteEnvVariable (ctx , "usr" , "1" , "r" , "variable" )
701701 })
702702}
703703
0 commit comments