@@ -9,38 +9,38 @@ import (
99)
1010
1111func TestNew (t * testing.T ) {
12- config , err := config .New ()
12+ c , err := config .New ()
1313 if ! assert .Nil (t , err ) {
1414 return
1515 }
16- if ! assert .NotNil (t , config ) {
16+ if ! assert .NotNil (t , c ) {
1717 return
1818 }
1919
20- iamService := config .
20+ iamService := c .
2121 Region ("us-east" ).
2222 Env ("client-test" ).
2323 Service ("iam" )
2424 if ! assert .NotNil (t , iamService ) {
2525 return
2626 }
27- url , err := iamService .String ("url " )
27+ url , err := iamService .String ("iam_url " )
2828 if ! assert .Nil (t , err ) {
2929 return
3030 }
3131 assert .Equal (t , "https://iam-client-test.us-east.philips-healthsuite.com" , url )
3232}
3333
3434func TestCartel (t * testing.T ) {
35- config , err := config .New ()
35+ c , err := config .New ()
3636 if ! assert .Nil (t , err ) {
3737 return
3838 }
39- if ! assert .NotNil (t , config ) {
39+ if ! assert .NotNil (t , c ) {
4040 return
4141 }
4242
43- cartelService := config .
43+ cartelService := c .
4444 Region ("us-east" ).
4545 Service ("cartel" )
4646 if ! assert .NotNil (t , cartelService ) {
@@ -81,14 +81,14 @@ func TestOpts(t *testing.T) {
8181}
8282
8383func TestMissing (t * testing.T ) {
84- config , err := config .New ()
84+ c , err := config .New ()
8585 if ! assert .Nil (t , err ) {
8686 return
8787 }
88- if ! assert .NotNil (t , config ) {
88+ if ! assert .NotNil (t , c ) {
8989 return
9090 }
91- missingService := config .
91+ missingService := c .
9292 Region ("us-east" ).
9393 Service ("bogus" )
9494 assert .False (t , missingService .Available ())
@@ -97,33 +97,36 @@ func TestMissing(t *testing.T) {
9797}
9898
9999func TestServices (t * testing.T ) {
100- config , err := config .New (
100+ c , err := config .New (
101101 config .WithRegion ("us-east" ),
102102 config .WithEnv ("client-test" ))
103103 if ! assert .Nil (t , err ) {
104104 return
105105 }
106- if ! assert .NotNil (t , config ) {
106+ if ! assert .NotNil (t , c ) {
107107 return
108108 }
109- services := config .Services ()
109+ services := c .Services ()
110110 assert .Less (t , 0 , len (services ))
111111}
112112
113113func TestKeys (t * testing.T ) {
114- config , err := config .New (
114+ c , err := config .New (
115115 config .WithRegion ("us-east" ),
116116 config .WithEnv ("client-test" ))
117117 if ! assert .Nil (t , err ) {
118118 return
119119 }
120- if ! assert .NotNil (t , config ) {
120+ if ! assert .NotNil (t , c ) {
121121 return
122122 }
123- cartel := config .Service ("cartel" )
123+ cartel := c .Service ("cartel" )
124124 assert .True (t , cartel .Available ())
125125 keys := cartel .Keys ()
126126 assert .Less (t , 0 , len (keys ))
127127 _ , err = cartel .String ("bogus" )
128128 assert .NotNil (t , err )
129+ port , err := cartel .Int ("port" )
130+ assert .Equal (t , config .ErrNotFound , err )
131+ assert .Equal (t , 0 , port )
129132}
0 commit comments