452
452
""" Just add the record to self.records. """
453
453
self.records.append(record)
455
def check(self, level, *msgs):
456
"""Verifies that the msgs are logged in the specified level."""
457
for rec in self.records:
458
if rec.levelno == level and all(m in rec.message for m in msgs):
462
def check_debug(self, *msgs):
463
"""Shortcut for checking in DEBUG."""
464
return self.check(logging.DEBUG, *msgs)
466
def check_info(self, *msgs):
467
"""Shortcut for checking in INFO."""
468
return self.check(logging.INFO, *msgs)
470
def check_warning(self, *msgs):
471
"""Shortcut for checking in WARNING."""
472
return self.check(logging.WARNING, *msgs)
474
def check_error(self, *msgs):
475
"""Shortcut for checking in ERROR."""
476
return self.check(logging.ERROR, *msgs)
456
479
class FakeNetworkManager(DBusExposedObject):
457
480
""" A fake NetworkManager that only emits StatusChanged signal. """