示例#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() == []
示例#2
0
def make_user(**kwargs):
    global last_auto_id
    last_auto_id += 1
    defaults = {
        "id": models.UserId(last_auto_id),
        "name": "Test User",
        "following": []
    }
    defaults.update(kwargs)
    return models.User(**defaults)