Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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_reprs_works():
repr(aioftp.Throttle())
repr(aioftp.Permission())
repr(aioftp.User())
def test_throttle_repr():
t = aioftp.Throttle(loop="loop")
nose.tools.eq_(repr(t), "Throttle(loop='loop', limit=None, reset_rate=10)")