mirror of https://github.com/fail2ban/fail2ban
BF: Fix FailRegex.search test case for 0.9
parent
ea2a13946e
commit
d1ea8e85f8
|
@ -72,7 +72,7 @@ class Regex:
|
|||
# Sets an internal cache (match object) in order to avoid searching for
|
||||
# the pattern again. This method must be called before calling any other
|
||||
# method of this object.
|
||||
# @param value the line
|
||||
# @param a list of tupples. The tupples are ( prematch, datematch, postdatematch )
|
||||
|
||||
def search(self, tupleLines):
|
||||
self._matchCache = self._regexObj.search(
|
||||
|
|
|
@ -753,7 +753,7 @@ class RegexTests(unittest.TestCase):
|
|||
# e.g. if we made it optional.
|
||||
fr = FailRegex('%%<HOST>?')
|
||||
self.assertFalse(fr.hasMatched())
|
||||
fr.search(("%%",))
|
||||
fr.search([('%%',"","")])
|
||||
self.assertTrue(fr.hasMatched())
|
||||
self.assertRaises(RegexException, fr.getHost)
|
||||
|
||||
|
|
Loading…
Reference in New Issue