Beispiel #1
0
  def test_redaction_rule_works(self):
    rule = RedactionRule('password='******'password="******"', 'password="******"')

    test_strings = [
        ('message', 'message'),
        ('password="******"', 'password="******"'),
        ('before password="******" after', 'before password="******" after'),
    ]

    for message, redacted_message in test_strings:
      assert_equal(rule.redact(message), redacted_message)
Beispiel #2
0
  def test_redaction_rule_works(self):
    rule = RedactionRule('password='******'password="******"', 'password="******"')

    test_strings = [
        ('message', 'message'),
        ('password="******"', 'password="******"'),
        ('before password="******" after', 'before password="******" after'),
    ]

    for message, redacted_message in test_strings:
      assert_equal(rule.redact(message), redacted_message)
Beispiel #3
0
  def test_non_redacted_string_returns_same_string(self):
    rule = RedactionRule('password='******'password="******"', 'password="******"')

    message = 'message'
    assert_true(rule.redact(message) is message)
Beispiel #4
0
  def test_non_redacted_string_returns_same_string(self):
    rule = RedactionRule('password='******'password="******"', 'password="******"')

    message = 'message'
    assert_true(rule.redact(message) is message)