def test_throttle_reset(): t = aioftp.Throttle(limit=1, reset_rate=1) t.append(b"-" * 3, 0) assert t._start == 0 assert t._sum == 3 t.append(b"-" * 3, 2) assert t._start == 2 assert t._sum == 4
def test_throttle_repr(): t = aioftp.Throttle(loop="loop") nose.tools.eq_(repr(t), "Throttle(loop='loop', limit=None, reset_rate=10)")
def test_reprs_works(): repr(aioftp.Throttle()) repr(aioftp.Permission()) repr(aioftp.User())