Jason R. Coombs  committed 7ea7e73

Fixed issue where feeds weren't being loaded from the database (because set.__init__ was being called after .update).

  • Participants
  • Parent commits f2e6b46
  • Tags 1104.4b4

Comments (0)

Files changed (2)

File pmxbot/

 	A database-backed set of feed entries that have been seen before.
 	def __init__(self, db_uri=None):
+		super(FeedHistory, self).__init__()
 		db_uri = db_uri or pmxbot.config.database = FeedparserDB.from_URI(db_uri)
 		timer = timing.Stopwatch()
 		self.update("Loaded feed history in %s", timer.split())
-		super(FeedHistory, self).__init__()
 	def __finalize(self):
 	def clear(self):
 		"Clear all entries"
-		self.db.remove()
+		self.db.remove(safe=True)

File tests/unit/

 def history(db_uri, request):
 	history = pmxbot.rss.FeedHistory(db_uri)
+	request.addfinalizer(
 	return history
 		orig_uri =
 		new_history = pmxbot.rss.FeedHistory(orig_uri)
 		assert len(new_history) == 1
-		assert new_history.add_seen_feed(entry) is False
+		assert new_history.add_seen_feed(entry, '') is False