Merge "Fix tox py27 error"
This commit is contained in:
commit
87c06eb437
@ -248,6 +248,7 @@ def file_discovery(file_candidates):
|
||||
for file in file_candidates:
|
||||
if os.path.isfile(file):
|
||||
return file
|
||||
return ''
|
||||
|
||||
|
||||
def start_service(service_candidates):
|
||||
|
@ -819,6 +819,10 @@ class TestOperatingSystem(trove_testtools.TestCase):
|
||||
config_file = operating_system.file_discovery(
|
||||
["/etc/mongodb.conf", "/etc/mongod.conf"])
|
||||
self.assertEqual('/etc/mongod.conf', config_file)
|
||||
with patch.object(os.path, 'isfile', side_effect=[False]):
|
||||
config_file = operating_system.file_discovery(
|
||||
["/etc/mongodb.conf"])
|
||||
self.assertEqual('', config_file)
|
||||
|
||||
def test_list_files_in_directory(self):
|
||||
root_path = tempfile.mkdtemp()
|
||||
|
Loading…
x
Reference in New Issue
Block a user