~facundo/ubuntuone-client/lr-dont-delete-partial-nopartialfile

« back to all changes in this revision

Viewing changes to contrib/testing/testcase.py

  • Committer: Tarmac
  • Author(s): facundo at com
  • Date: 2010-09-24 20:52:03 UTC
  • mfrom: (720.1.3 ping-it-baby)
  • Revision ID: tarmac-20100924205203-ql0vtr0qezvuwwoc
Client periodically pings the server to check connection.

Show diffs side-by-side

added added

removed removed

Lines of Context:
409
409
        """ Create the instance, and add a records attribute. """
410
410
        logging.Handler.__init__(self, *args, **kwargs)
411
411
        self.records = []
 
412
        self.debug = False
412
413
 
413
414
    def emit(self, record):
414
415
        """ Just add the record to self.records. """
419
420
        for rec in self.records:
420
421
            if rec.levelno == level and all(m in rec.message for m in msgs):
421
422
                return True
 
423
        if self.debug:
 
424
            recorded =  [(logging.getLevelName(r.levelno), r.message)
 
425
                         for r in self.records]
 
426
            print "Memento messages:", recorded
422
427
        return False
423
428
 
424
429
    def check_debug(self, *msgs):