aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin André <m.andre@redhat.com>2017-07-04 15:31:35 +0200
committerMartin André <m.andre@redhat.com>2017-07-06 11:18:53 +0200
commitf54f3406308406a158737c468c5e61ddb1eb61a2 (patch)
treec0d8e4aac6d5de8a1cd3b38e5a136350aeb127a8 /tests
parentdb38eef3aeef372eb4149ca43f72df0aaed1b6d6 (diff)
downloadkolla-f54f3406308406a158737c468c5e61ddb1eb61a2.tar.gz
kolla-f54f3406308406a158737c468c5e61ddb1eb61a2.zip
Make set_configs.py work with symlinks
Closes-Bug: #1702305 Change-Id: I92a404b8d301937dc1847d42576e30db43951990
Diffstat (limited to 'tests')
-rw-r--r--tests/test_set_config.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/test_set_config.py b/tests/test_set_config.py
index 643b5ba54..e4706c99d 100644
--- a/tests/test_set_config.py
+++ b/tests/test_set_config.py
@@ -77,41 +77,41 @@ FAKE_CONFIG_FILE = FAKE_CONFIG_FILES[0]
class ConfigFileTest(base.BaseTestCase):
- @mock.patch('os.path.exists', return_value=False)
- def test_delete_path_not_exists(self, mock_exists):
+ @mock.patch('os.path.lexists', return_value=False)
+ def test_delete_path_not_exists(self, mock_lexists):
config_file = copy.deepcopy(FAKE_CONFIG_FILE)
config_file._delete_path(config_file.dest)
- mock_exists.assert_called_with(config_file.dest)
+ mock_lexists.assert_called_with(config_file.dest)
- @mock.patch('os.path.exists', return_value=True)
+ @mock.patch('os.path.lexists', return_value=True)
@mock.patch('os.path.isdir', return_value=True)
@mock.patch('shutil.rmtree')
def test_delete_path_exist_dir(self,
mock_rmtree,
mock_isdir,
- mock_exists):
+ mock_lexists):
config_file = copy.deepcopy(FAKE_CONFIG_FILE)
config_file._delete_path(config_file.dest)
- mock_exists.assert_called_with(config_file.dest)
+ mock_lexists.assert_called_with(config_file.dest)
mock_isdir.assert_called_with(config_file.dest)
mock_rmtree.assert_called_with(config_file.dest)
- @mock.patch('os.path.exists', return_value=True)
+ @mock.patch('os.path.lexists', return_value=True)
@mock.patch('os.path.isdir', return_value=False)
@mock.patch('os.remove')
def test_delete_path_exist_file(self,
mock_remove,
mock_isdir,
- mock_exists):
+ mock_lexists):
config_file = copy.deepcopy(FAKE_CONFIG_FILE)
config_file._delete_path(config_file.dest)
- mock_exists.assert_called_with(config_file.dest)
+ mock_lexists.assert_called_with(config_file.dest)
mock_isdir.assert_called_with(config_file.dest)
mock_remove.assert_called_with(config_file.dest)