def test_AuthselectScannerLibrary_step_detect_if_confirmation_is_required__badlink( mock_getmtime, mock_isfile, mock_islink, mock_readlink): obj = AuthselectScannerLibrary([], Authconfig(''), DConf(''), PAM(''), '') mock_isfile.return_value = True mock_islink.return_value = True mock_readlink.return_value = '' assert obj.step_detect_if_confirmation_is_required()
def test_AuthselectScannerLibrary_step_detect_if_confirmation_is_required__pass( mock_getmtime, mock_isfile, mock_islink, mock_readlink): def my_getmtime(path): # Make sysconfig file younger then other files. if path == '/etc/sysconfig/authconfig': return 200 return 100 obj = AuthselectScannerLibrary([], Authconfig(''), DConf(''), PAM(''), '') mock_isfile.return_value = True mock_islink.return_value = True mock_readlink.side_effect = '{}-ac'.format mock_getmtime.side_effect = my_getmtime assert not obj.step_detect_if_confirmation_is_required()