def _split_user_and_password_type_entry(result: dict): new_result = {} for key, value in result.items(): if not flt.is_not_mandatory_analysis_entry(key): continue if ':' in key: *user_elements, password_type = key.split(':') user = '******'.join(user_elements) else: # for backward compatibility user = key password_type = 'unix' new_result.setdefault(user, {})[password_type] = value return new_result
def test_is_not_mandatory_analysis_entry(input_data, additional, expected_result): assert is_not_mandatory_analysis_entry(input_data, additional) is expected_result