@@ -209,17 +209,32 @@ def test_main(
209209 mock_logger_setup ,
210210 mock_update_regionsrv_setup ,
211211 ):
212+ def isdir_side_effect (path ):
213+ if path == '/system-root/usr/share/pki/trust/anchors/foo' :
214+ return False
215+ elif path == '/system-root/usr/share/pki/trust/anchors/bar' :
216+ return False
217+ elif path == '/system-root/etc/pki/trust/anchors/foo' :
218+ return False
219+ elif path == '/system-root/link_target' :
220+ return False
221+ return True
222+
223+ def exists_side_effect (path ):
224+ if path == '/var/log/zypper.log' :
225+ return False
226+ return True
212227
213228 mock_readlink .return_value = 'link_target'
214- mock_path_isdir .side_effect = [ True , True , True , True ]
229+ mock_path_isdir .side_effect = isdir_side_effect
215230 migration_config = Mock ()
216231 migration_config .is_zypper_migration_plugin_requested .return_value = True
217232 mock_MigrationConfig .return_value = migration_config
218233 fstab = Mock ()
219234 mock_Fstab .return_value = fstab
220235 mock_os_listdir .side_effect = [['foo' , 'bar' ], ['foo' , 'bar' ], ['fooSMT' ], ['fooSMT' ]]
221236 mock_os_path_islink .side_effect = [False , False , False , True ]
222- mock_os_path_exists .side_effect = [ True , True , True , True , False , True , True , True ]
237+ mock_os_path_exists .side_effect = exists_side_effect
223238 mock_is_registered .return_value = True
224239 mock_Command_run .side_effect = [
225240 MagicMock (),
0 commit comments