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

All Samples(4)  |  Call(3)  |  Derive(0)  |  Import(1)

src/d/h/DHTBot-HEAD/dhtbot/test/extensions/test_rate_limiter.py   DHTBot(Download)
from twisted.trial import unittest
from twisted.python.monkey import MonkeyPatcher
 
from dhtbot.extensions import rate_limiter
from dhtbot.extensions.rate_limiter import \
    def test_consume_enoughBW(self):
        rl = RateLimiter()
        consumed = rl.consume(self.packet, self.address)
        self.assertTrue(consumed)
 
    def test_consume_overflowHostAndReset(self):
        rl = RateLimiter()
        address3 = ("127.0.0.1", 8888)
        address4 = ("127.0.0.1", 7777)
        rl = RateLimiter()
        # Consume first, second, and third packets
        consumed = rl.consume(self.packet, address1)