1919
2020from .config_exception import ConfigException
2121from .exec_provider import ExecProvider
22+ from .kube_config import ConfigNode
2223
2324
2425class ExecProviderTest (unittest .TestCase ):
2526
2627 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+ })
3134 self .output_ok = """
3235 {
3336 "apiVersion": "client.authentication.k8s.io/v1beta1",
@@ -39,7 +42,9 @@ def setUp(self):
3942 """
4043
4144 def test_missing_input_keys (self ):
42- exec_configs = [{}, {'command' : '' }, {'apiVersion' : '' }]
45+ exec_configs = [ConfigNode ('test1' , {}),
46+ ConfigNode ('test2' , {'command' : '' }),
47+ ConfigNode ('test3' , {'apiVersion' : '' })]
4348 for exec_config in exec_configs :
4449 with self .assertRaises (ConfigException ) as context :
4550 ExecProvider (exec_config )
0 commit comments