Example #1
0
def test_aggregator_interface():
    agg = inbox.AggregatorInterface(FakeRepo())

    agg.add(
        models.InboxEvent(models.InboxEventId(1),
                          models.UserId(2),
                          published=now()))
    assert agg.aggregate() == []
Example #2
0
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)
Example #3
0
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)