Fix tox cover environment on python 3.6
In python 3.6, os.path.join does not accept Mock objects, giving the
following error:
TypeError: expected str, bytes or os.PathLike object, not MagicMock
Since the switch to use ubuntu bionic for the base image for jobs,
python 3.6 is the default for python 3.
Change-Id: I79bec585361a54b8303c130a363c62d9a4b7faae
Story: 2004959
Task: 30035
(cherry picked from commit 14bfce8a72
)
This commit is contained in:
parent
3a5d46c1ad
commit
e69c4d4a88
|
@ -285,7 +285,8 @@ class TestCase(unittest.TestCase):
|
|||
mock_rmtree):
|
||||
parser = argparse.ArgumentParser()
|
||||
parsed_args = parser.parse_args([])
|
||||
dump_dir = mock_mkdtemp.return_value
|
||||
dump_dir = "/path/to/dump"
|
||||
mock_mkdtemp.return_value = dump_dir
|
||||
mock_listdir.return_value = ["host1.yml", "host2.yml"]
|
||||
mock_read.side_effect = [
|
||||
{"var1": "value1"},
|
||||
|
|
Loading…
Reference in New Issue