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

All Samples(6)  |  Call(5)  |  Derive(0)  |  Import(1)

src/d/h/DHTBot-HEAD/dhtbot/test/extensions/test_quarantine.py   DHTBot(Download)
from twisted.trial import unittest
 
from dhtbot.extensions.quarantine import Quarantine
from dhtbot.contact import Node
from dhtbot.protocols.errors import TimeoutError
    def test_jail_singlePrisoner(self):
        self.refresh()
        q = Quarantine(self.pc.ping, self.rt)
        n = Node(2**150, ("127.0.0.1", 58))
        q.jail(n)
        self.assertEquals(1, self.pc.ping_count)
 
    def test_jail_singlePrisonerCallBack(self):
        self.refresh()
        q = Quarantine(self.pc.ping, self.rt)
    def test_jail_singlePrisonerErrback(self):
        self.refresh()
        q = Quarantine(self.pc.ping, self.rt)
        n = Node(2**35, ("127.0.0.1", 255))
        q.jail(n)
    def test_jail_singlePrisonerErrbackThenCallback(self):
        self.refresh()
        q = Quarantine(self.pc.ping, self.rt)
        n = Node(2**51, ("127.0.0.1", 9555))
        q.jail(n)