Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(16)  |  Call(13)  |  Derive(0)  |  Import(3)

src/f/a/fail2ban-HEAD/fail2ban/tests/databasetestcase.py   fail2ban(Download)
from ..server.filter import FileContainer
from ..server.mytime import MyTime
from ..server.ticket import FailTicket
from .dummyjail import DummyJail
try:
		self.assertEqual(self.db.getJailNames(), set(['DummyJail #29162448 with 0 tickets']))
		self.assertEqual(self.db.getLogPaths(), set(['/tmp/Fail2BanDb_pUlZJh.log']))
		ticket = FailTicket("127.0.0.1", 1388009242.26, [u"abc\n"])
		self.assertEqual(self.db.getBans()[0], ticket)
 
	def testAddBan(self):
		if Fail2BanDb is None: # pragma: no cover
			return
		self.testAddJail()
		ticket = FailTicket("127.0.0.1", 0, ["abc\n"])
		self.testAddJail()
		self.db.addBan(
			self.jail, FailTicket("127.0.0.1", MyTime.time() - 60, ["abc\n"]))
		self.db.addBan(
			self.jail, FailTicket("127.0.0.1", MyTime.time() - 40, ["abc\n"]))

src/f/a/fail2ban-HEAD/fail2ban/tests/failmanagertestcase.py   fail2ban(Download)
 
from ..server.failmanager import FailManager, FailManagerEmpty
from ..server.ticket import FailTicket
 
class AddFailure(unittest.TestCase):
		self.__failManager = FailManager()
		for i in self.__items:
			self.__failManager.addFailure(FailTicket(i[0], i[1]))
 
	def tearDown(self):

src/f/a/Fail2Ban-Old-SVNGIT-HEAD/testcases/failmanagertestcase.py   Fail2Ban-Old-SVNGIT(Download)
import unittest, socket, time, pickle
from server.failmanager import FailManager, FailManagerEmpty
from server.ticket import FailTicket
 
class AddFailure(unittest.TestCase):
		self.__failManager = FailManager()
		for i in self.__items:
			self.__failManager.addFailure(FailTicket(i[0], i[1]))
 
	def tearDown(self):