Skip to content

Commit 83c3307

Browse files
committed
suggestions
1 parent 02fa154 commit 83c3307

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Created by importer

cloudify_kubernetes/tests/test_utils.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,16 @@
5353
---
5454
"""
5555

56-
test_dir1 = mkdtemp()
57-
5856

5957
class TestUtils(unittest.TestCase):
6058

61-
@patch('cloudify_kubernetes.utils.get_node_instance_dir',
62-
return_value=test_dir1)
59+
@patch('cloudify_kubernetes.utils.get_node_instance_dir')
6360
@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+
6566
some_directory = 'github.com/kubernetes-sigs/aws-ebs-csi-driver/' \
6667
'deploy/kubernetes/overlays/stable/?ref=release-1.14'
6768
listdir = ['cloudbuild.yaml', 'hack', 'tests', 'SECURITY_CONTACTS',
@@ -71,9 +72,9 @@ def test_set_directory_path(*_, **__):
7172
'NOTICE', 'CONTRIBUTING.md', 'pkg', 'OWNERS',
7273
'CHANGELOG.md']
7374

74-
resalt = utils.set_directory_path(some_directory,
75+
result = utils.set_directory_path(some_directory,
7576
target_path=test_dir1)
76-
assert os.listdir(resalt) == listdir
77+
self.assertEqual(sorted(os.listdir(result)), sorted(listdir))
7778
shutil.rmtree(test_dir1)
7879

7980
def test_get_archive_from_github_url(*_, **__):

0 commit comments

Comments
 (0)