def test_aggregator_interface(): agg = inbox.AggregatorInterface(FakeRepo()) agg.add( models.InboxEvent(models.InboxEventId(1), models.UserId(2), published=now())) assert agg.aggregate() == []
def make_commented(**kwargs): global last_auto_id last_auto_id += 1 defaults = { "id": models.InboxEventId(last_auto_id), "comment_text": "Test comment", "published": now(), } defaults.update(kwargs) return models.CommentedEvent(**defaults)
def make_liked(**kwargs): global last_auto_id last_auto_id += 1 defaults = {"id": models.InboxEventId(last_auto_id), "published": now()} defaults.update(kwargs) return models.LikedEvent(**defaults)