def _run_databasesanity(objects): try: databasesanity.check_sanity(objects, quiet=True, really_quiet=(not util.chatter)) except databasesanity.DatabaseInsaneError, e: logging.warn("Old database fails sanity test: %s", e) objects[:] = []
def test_manual_feed_checking(self): f = feed.Feed(u"dtv:manualFeed") f2 = feed.Feed(u"dtv:manualFeed") f3 = feed.Feed(u"dtv:manualFeed") self.check_object_list_passes_test([f]) self.check_object_list_fails_test([f, f2]) self.error_signal_okay = True test_list = [f, f2, f3] databasesanity.check_sanity(test_list) self.assertEquals(len(test_list), 1) self.assertEquals(self.saw_error, True)
def check_object_list_passes_test(self, object_list): databasesanity.check_sanity(object_list)
def check_fix_if_possible(self, start_list, fixed_list): self.error_signal_okay = True rv = databasesanity.check_sanity(start_list) self.assertEquals(start_list, fixed_list) self.assertEquals(rv, False) self.assertEquals(self.saw_error, True)