Fix mock_open call to use new multifile syntax

This commit is contained in:
Erik Johnson 2018-06-17 22:42:30 -05:00
parent 7f516ef73a
commit 55487c175c
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -164,7 +164,7 @@ class NetworkTestCase(TestCase):
## ccc
127.0.0.1 localhost thisismyhostname # 本机
''')
fopen_mock = mock_open(read_data=content, match='/etc/hosts')
fopen_mock = mock_open(read_data={'/etc/hosts': content})
with patch('salt.utils.files.fopen', fopen_mock):
assert 'thisismyhostname' in network._generate_minion_id()