示例#1
0
文件: tests.py 项目: cloudera/hue
  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)
示例#2
0
文件: tests.py 项目: xuejunshuang/hue
  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)
示例#3
0
文件: tests.py 项目: cloudera/hue
  def test_non_redacted_string_returns_same_string(self):
    rule = RedactionRule('password='******'password="******"', 'password="******"')

    message = 'message'
    assert_true(rule.redact(message) is message)
示例#4
0
文件: tests.py 项目: xuejunshuang/hue
  def test_non_redacted_string_returns_same_string(self):
    rule = RedactionRule('password='******'password="******"', 'password="******"')

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