53
53
---
54
54
"""
55
55
56
- test_dir1 = mkdtemp ()
57
-
58
56
59
57
class TestUtils (unittest .TestCase ):
60
58
61
- @patch ('cloudify_kubernetes.utils.get_node_instance_dir' ,
62
- return_value = test_dir1 )
59
+ @patch ('cloudify_kubernetes.utils.get_node_instance_dir' )
63
60
@patch ('cloudify_common_sdk.utils.get_deployment_dir' )
64
- def test_set_directory_path (* _ , ** __ ):
61
+ def test_set_directory_path (self , * args , ** __ ):
62
+ get_node_instance_dir = args [1 ]
63
+ test_dir1 = mkdtemp ()
64
+ get_node_instance_dir .return_value = test_dir1
65
+
65
66
some_directory = 'github.com/kubernetes-sigs/aws-ebs-csi-driver/' \
66
67
'deploy/kubernetes/overlays/stable/?ref=release-1.14'
67
68
listdir = ['cloudbuild.yaml' , 'hack' , 'tests' , 'SECURITY_CONTACTS' ,
@@ -71,9 +72,9 @@ def test_set_directory_path(*_, **__):
71
72
'NOTICE' , 'CONTRIBUTING.md' , 'pkg' , 'OWNERS' ,
72
73
'CHANGELOG.md' ]
73
74
74
- resalt = utils .set_directory_path (some_directory ,
75
+ result = utils .set_directory_path (some_directory ,
75
76
target_path = test_dir1 )
76
- assert os .listdir (resalt ) == listdir
77
+ self . assertEqual ( sorted ( os .listdir (result )), sorted ( listdir ))
77
78
shutil .rmtree (test_dir1 )
78
79
79
80
def test_get_archive_from_github_url (* _ , ** __ ):
0 commit comments