@@ -55,38 +55,38 @@ describe('OpenwhiskProvider', () => {
55
55
56
56
describe ( '#client()' , ( ) => {
57
57
it ( 'should return pre-configured openwhisk client' , ( ) => {
58
- openwhiskProvider . _client = null
58
+ openwhiskProvider . _client = null
59
59
const creds = { apihost : 'some_api' , auth : 'user:pass' }
60
60
sandbox . stub ( openwhiskProvider , "props" ) . returns ( BbPromise . resolve ( creds ) )
61
61
return openwhiskProvider . client ( ) . then ( client => {
62
- expect ( client . actions . client . options ) . to . be . deep . equal ( { apigwToken : undefined , apigwSpaceGuid : undefined , namespace : undefined , apiKey : creds . auth , ignoreCerts : false , api : `https://${ creds . apihost } /api/v1/` } )
62
+ expect ( client . actions . client . options ) . to . be . deep . equal ( { apigwToken : undefined , apigwSpaceGuid : undefined , namespace : undefined , apiKey : creds . auth , ignoreCerts : false , api : `https://${ creds . apihost } /api/v1/` , authHandler : undefined , noUserAgent : undefined } )
63
63
expect ( typeof openwhiskProvider . _client ) . to . not . equal ( 'undefined' ) ;
64
64
} )
65
65
} )
66
66
67
67
it ( 'should allow ignore_certs options for openwhisk client' , ( ) => {
68
- openwhiskProvider . _client = null
68
+ openwhiskProvider . _client = null
69
69
const creds = { apihost : 'some_api' , auth : 'user:pass' }
70
70
sandbox . stub ( openwhiskProvider , "props" ) . returns ( BbPromise . resolve ( creds ) )
71
71
openwhiskProvider . serverless . service . provider . ignore_certs = true
72
72
return openwhiskProvider . client ( ) . then ( client => {
73
- expect ( client . actions . client . options ) . to . be . deep . equal ( { apigwToken : undefined , apigwSpaceGuid : undefined , namespace : undefined , apiKey : creds . auth , ignoreCerts : true , api : `https://${ creds . apihost } /api/v1/` } )
73
+ expect ( client . actions . client . options ) . to . be . deep . equal ( { apigwToken : undefined , apigwSpaceGuid : undefined , namespace : undefined , apiKey : creds . auth , ignoreCerts : true , api : `https://${ creds . apihost } /api/v1/` , authHandler : undefined , noUserAgent : undefined } )
74
74
expect ( typeof openwhiskProvider . _client ) . to . not . equal ( 'undefined' ) ;
75
75
} )
76
76
} )
77
77
78
- it ( 'should allow apigw_access_toekn option for openwhisk client' , ( ) => {
79
- openwhiskProvider . _client = null
78
+ it ( 'should allow apigw_access_token option for openwhisk client' , ( ) => {
79
+ openwhiskProvider . _client = null
80
80
const creds = { apihost : 'some_api' , auth : 'user:pass' , apigw_access_token : 'token' }
81
81
sandbox . stub ( openwhiskProvider , "props" ) . returns ( BbPromise . resolve ( creds ) )
82
82
return openwhiskProvider . client ( ) . then ( client => {
83
- expect ( client . actions . client . options ) . to . be . deep . equal ( { apigwToken : 'token' , apigwSpaceGuid : 'user' , namespace : undefined , apiKey : creds . auth , ignoreCerts : false , api : `https://${ creds . apihost } /api/v1/` } )
83
+ expect ( client . actions . client . options ) . to . be . deep . equal ( { apigwToken : 'token' , apigwSpaceGuid : 'user' , namespace : undefined , apiKey : creds . auth , ignoreCerts : false , api : `https://${ creds . apihost } /api/v1/` , authHandler : undefined , noUserAgent : undefined } )
84
84
expect ( typeof openwhiskProvider . _client ) . to . not . equal ( 'undefined' ) ;
85
85
} )
86
86
} )
87
87
88
88
it ( 'should cache client instance' , ( ) => {
89
- openwhiskProvider . _client = { }
89
+ openwhiskProvider . _client = { }
90
90
return openwhiskProvider . client ( ) . then ( client => {
91
91
expect ( client ) . to . be . equal ( openwhiskProvider . _client )
92
92
} )
@@ -95,7 +95,7 @@ describe('OpenwhiskProvider', () => {
95
95
96
96
describe ( '#props()' , ( ) => {
97
97
it ( 'should return promise that resolves with provider credentials' , ( ) => {
98
- openwhiskProvider . _props = null
98
+ openwhiskProvider . _props = null
99
99
const creds = { apihost : 'some_api' , auth : 'user:pass' , namespace : 'namespace' }
100
100
sandbox . stub ( Credentials , "getWskProps" ) . returns ( BbPromise . resolve ( creds ) )
101
101
return openwhiskProvider . props ( ) . then ( props => {
@@ -105,7 +105,7 @@ describe('OpenwhiskProvider', () => {
105
105
} ) ;
106
106
107
107
it ( 'should return cached provider credentials' , ( ) => {
108
- openwhiskProvider . _props = { }
108
+ openwhiskProvider . _props = { }
109
109
const stub = sandbox . stub ( Credentials , "getWskProps" )
110
110
return openwhiskProvider . props ( ) . then ( props => {
111
111
expect ( props ) . to . be . equal ( openwhiskProvider . _props )
@@ -136,4 +136,4 @@ describe('OpenwhiskProvider', () => {
136
136
return expect ( ( ) => openwhiskProvider . hasValidCreds ( mockObject ) ) . to . throw ( / O W _ A P I H O S T / ) ;
137
137
} ) ;
138
138
} )
139
- } )
139
+ } )
0 commit comments