mirror of https://github.com/fail2ban/fail2ban
makes test case more precise;
parent
6c788a32ee
commit
2bfe22aa66
|
@ -38,8 +38,8 @@ ver. 0.9.2 (2014/XX/XXX) - wanna-be-released
|
|||
system authentication issues
|
||||
* fail2ban-regex reads filter file(s) completely, incl. '.local' file etc. (gh-954)
|
||||
* firewallcmd-* actions: split output into separate lines for grepping (gh-908)
|
||||
* binding parameter error (unsupported type) by writing json with invalid encoded
|
||||
lines into sqlite database (gh-973), thanks to kot for issue reporting;
|
||||
* Guard unicode encode/decode issues while storing records in the database.
|
||||
Fixes "binding parameter error (unsupported type)" (gh-973), thanks to kot for reporting
|
||||
|
||||
- New Features:
|
||||
- New filters:
|
||||
|
|
|
@ -181,12 +181,16 @@ class DatabaseTest(LogCaptureTestCase):
|
|||
if Fail2BanDb is None: # pragma: no cover
|
||||
return
|
||||
self.testAddJail()
|
||||
ticket = FailTicket("127.0.0.1", 0, {'m': ['... user "\xd1\xe2\xe5\xf2\xe0" ...'], 'a': 1})
|
||||
ticket = FailTicket("127.0.0.1", 0, ['... user "\xd1\xe2\xe5\xf2\xe0" ...'])
|
||||
self.db.addBan(self.jail, ticket)
|
||||
|
||||
self.assertEqual(len(self.db.getBans(jail=self.jail)), 1)
|
||||
readticket = self.db.getBans(jail=self.jail)[0]
|
||||
## python 2 or 3 :
|
||||
self.assertTrue(
|
||||
isinstance(self.db.getBans(jail=self.jail)[0], FailTicket))
|
||||
readticket == FailTicket("127.0.0.1", 0, [u'... user "\ufffd\ufffd\ufffd\ufffd\ufffd" ...'])
|
||||
or readticket == ticket
|
||||
)
|
||||
|
||||
def testDelBan(self):
|
||||
self.testAddBan()
|
||||
|
|
Loading…
Reference in New Issue