Ejemplo n.º 1
0
def test_password_sanitizer_multiline() -> None:
    diff_fst, expected_fst = _edit_rule("value/instance/api_key/[1")
    diff_snd, expected_snd = _edit_rule("value/instance/app_key/[1")
    diff = "\n".join([diff_fst, diff_snd])
    expected = "\n".join([expected_fst, expected_snd])

    sanitizer = update_config.PasswordSanitizer()
    entry = sanitizer.replace_password(mock_audit_log_entry("edit-rule", diff))
    assert entry.diff_text == expected
Ejemplo n.º 2
0
def test_password_sanitizer_new_rule(diff: str, expected: str) -> None:
    sanitizer = update_config.PasswordSanitizer()
    entry = sanitizer.replace_password(mock_audit_log_entry("new-rule", diff))
    assert entry.diff_text == expected
Ejemplo n.º 3
0
def test_password_sanitizer_edit_rule(diff, expected):
    sanitizer = update_config.PasswordSanitizer()
    entry = sanitizer.replace_password(mock_audit_log_entry("edit-rule", diff))
    assert entry.diff_text == expected