test_sched.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:dsq 作者: baverman 项目源码 文件源码
def test_interval_timer():
    t = Timer()
    assert not list(t)

    t.add('foo', 10, 10)
    t.add('boo', 20, 20)
    t.add('bar', 30, 30)

    result = list(islice(t, 11))
    assert result == [(10, 'foo'), (20, 'foo'), (20, 'boo'), (30, 'foo'),
                      (30, 'bar'), (40, 'foo'), (40, 'boo'), (50, 'foo'),
                      (60, 'foo'), (60, 'boo'), (60, 'bar')]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号