Exemplo n.º 1
0
    def startUnchecked(self):
        loggable.init(self.options, cattivo.config)

        self.ensureTwistedPair()
        dfr = task.coiterate(self.iterateStart())
        return dfr
Exemplo n.º 2
0
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from twisted.trial.unittest import TestCase
from tests.common import new_client_id
from cattivo.holes import Hole, Holes, HoleEntry, HoleError, DEFAULT_EXPIRATION
from cattivo.utils import SECOND, MINUTE, HOUR
from cattivo.log import loggable

loggable.init()

class FakeHoles(Holes):
    def __init__(self):
        Holes.__init__(self, firewall=None)
        self.test_expired = []
        self.test_now = 0

    def now(self):
        return self.test_now

    def _addFirewall(self, hole_entry):
        pass

    def _removeFirewall(self, hole_entry):
        pass
Exemplo n.º 3
0
 def initLog(self):
     loggable.init(self.options, cattivo.config)