"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "fail2ban/tests/failmanagertestcase.py" between
fail2ban-0.10.5.tar.gz and fail2ban-0.11.1.tar.gz

About:

failmanagertestcase.py  (fail2ban-0.10.5):failmanagertestcase.py  (fail2ban-0.11.1)
skipping to change at line 161 skipping to change at line 161
ticket = self.__failManager.toBan() ticket = self.__failManager.toBan()
self.assertEqual(ticket.getIP(), "193.168.0.128") self.assertEqual(ticket.getIP(), "193.168.0.128")
self.assertTrue(isinstance(ticket.getIP(), (str, IPAddr))) self.assertTrue(isinstance(ticket.getIP(), (str, IPAddr)))
# finish with rudimentary tests of the ticket # finish with rudimentary tests of the ticket
# verify consistent str # verify consistent str
ticket_str = str(ticket) ticket_str = str(ticket)
ticket_repr = repr(ticket) ticket_repr = repr(ticket)
self.assertEqual( self.assertEqual(
ticket_str, ticket_str,
'FailTicket: ip=193.168.0.128 time=1167605999.0 #attempts =5 matches=[]') 'FailTicket: ip=193.168.0.128 time=1167605999.0 bantime=N one bancount=0 #attempts=5 matches=[]')
self.assertEqual( self.assertEqual(
ticket_repr, ticket_repr,
'FailTicket: ip=193.168.0.128 time=1167605999.0 #attempts =5 matches=[]') 'FailTicket: ip=193.168.0.128 time=1167605999.0 bantime=N one bancount=0 #attempts=5 matches=[]')
self.assertFalse(not ticket) self.assertFalse(not ticket)
# and some get/set-ers otherwise not tested # and some get/set-ers otherwise not tested
ticket.setTime(1000002000.0) ticket.setTime(1000002000.0)
self.assertEqual(ticket.getTime(), 1000002000.0) self.assertEqual(ticket.getTime(), 1000002000.0)
# and str() adjusted correspondingly # and str() adjusted correspondingly
self.assertEqual( self.assertEqual(
str(ticket), str(ticket),
'FailTicket: ip=193.168.0.128 time=1000002000.0 #attempts =5 matches=[]') 'FailTicket: ip=193.168.0.128 time=1000002000.0 bantime=N one bancount=0 #attempts=5 matches=[]')
def testbanNOK(self): def testbanNOK(self):
self._addDefItems() self._addDefItems()
self.__failManager.setMaxRetry(10) self.__failManager.setMaxRetry(10)
self.assertRaises(FailManagerEmpty, self.__failManager.toBan) self.assertRaises(FailManagerEmpty, self.__failManager.toBan)
def testWindow(self): def testWindow(self):
self._addDefItems() self._addDefItems()
ticket = self.__failManager.toBan() ticket = self.__failManager.toBan()
self.assertNotEqual(ticket.getIP(), "100.100.10.10") self.assertNotEqual(ticket.getIP(), "100.100.10.10")
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)