@@ -132,6 +132,7 @@ def setUp(self):
132
132
self .conn = mock .sentinel .conn
133
133
self .os_root_dir = '/root'
134
134
self .chroot_path = '/root/etc/resolv.conf'
135
+ self .joined_chroot_path = '/root/root/etc/resolv.conf'
135
136
self .os_root_device = mock .sentinel .os_root_device
136
137
self .hypervisor = mock .sentinel .hypervisor
137
138
self .event_manager = mock .MagicMock ()
@@ -288,45 +289,33 @@ def test_get_update_grub2_command(self):
288
289
def test__test_path (self , mock_test_ssh_path ):
289
290
result = self .os_morphing_tools ._test_path (self .chroot_path )
290
291
291
- mocked_full_path = os .path .join (
292
- self .os_morphing_tools ._os_root_dir , self .chroot_path )
293
-
294
292
mock_test_ssh_path .assert_called_once_with (
295
- self .os_morphing_tools ._ssh , mocked_full_path )
293
+ self .os_morphing_tools ._ssh , self . joined_chroot_path )
296
294
self .assertEqual (result , mock_test_ssh_path .return_value )
297
295
298
296
@mock .patch .object (base .utils , 'read_ssh_file' )
299
297
def test__read_file (self , mock_read_ssh_file ):
300
298
result = self .os_morphing_tools ._read_file (self .chroot_path )
301
299
302
- mocked_full_path = os .path .join (
303
- self .os_morphing_tools ._os_root_dir , self .chroot_path )
304
-
305
300
mock_read_ssh_file .assert_called_once_with (
306
- self .os_morphing_tools ._ssh , mocked_full_path )
301
+ self .os_morphing_tools ._ssh , self . joined_chroot_path )
307
302
self .assertEqual (result , mock_read_ssh_file .return_value )
308
303
309
304
@mock .patch .object (base .utils , 'write_ssh_file' )
310
305
def test__write_file (self , mock_write_ssh_file ):
311
306
self .os_morphing_tools ._write_file (
312
307
self .chroot_path , mock .sentinel .content )
313
308
314
- mocked_full_path = os .path .join (
315
- self .os_morphing_tools ._os_root_dir , self .chroot_path )
316
-
317
309
mock_write_ssh_file .assert_called_once_with (
318
- self .os_morphing_tools ._ssh , mocked_full_path ,
310
+ self .os_morphing_tools ._ssh , self . joined_chroot_path ,
319
311
mock .sentinel .content )
320
312
321
313
@mock .patch .object (base .utils , 'list_ssh_dir' )
322
314
def test__list_dir (self , mock_list_ssh_dir ):
323
315
result = self .os_morphing_tools ._list_dir (self .chroot_path )
324
316
325
- mocked_full_path = os .path .join (
326
- self .os_morphing_tools ._os_root_dir , self .chroot_path )
327
-
328
317
mock_list_ssh_dir .assert_called_once_with (
329
- self .os_morphing_tools ._ssh , mocked_full_path )
318
+ self .os_morphing_tools ._ssh , self . joined_chroot_path )
330
319
self .assertEqual (result , mock_list_ssh_dir .return_value )
331
320
332
321
@mock .patch .object (base .utils , 'exec_ssh_cmd' )
0 commit comments