19
19
20
20
from .config_exception import ConfigException
21
21
from .exec_provider import ExecProvider
22
+ from .kube_config import ConfigNode
22
23
23
24
24
25
class ExecProviderTest (unittest .TestCase ):
25
26
26
27
def setUp (self ):
27
- self .input_ok = {
28
- 'command' : 'aws-iam-authenticator token -i dummy' ,
29
- 'apiVersion' : 'client.authentication.k8s.io/v1beta1'
30
- }
28
+ self .input_ok = ConfigNode ('test' , {
29
+ 'command' : 'aws-iam-authenticator' ,
30
+ 'args' : ['token' , '-i' , 'dummy' ],
31
+ 'apiVersion' : 'client.authentication.k8s.io/v1beta1' ,
32
+ 'env' : None
33
+ })
31
34
self .output_ok = """
32
35
{
33
36
"apiVersion": "client.authentication.k8s.io/v1beta1",
@@ -39,7 +42,9 @@ def setUp(self):
39
42
"""
40
43
41
44
def test_missing_input_keys (self ):
42
- exec_configs = [{}, {'command' : '' }, {'apiVersion' : '' }]
45
+ exec_configs = [ConfigNode ('test1' , {}),
46
+ ConfigNode ('test2' , {'command' : '' }),
47
+ ConfigNode ('test3' , {'apiVersion' : '' })]
43
48
for exec_config in exec_configs :
44
49
with self .assertRaises (ConfigException ) as context :
45
50
ExecProvider (exec_config )
0 commit comments