mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-02 13:04:50 +00:00
18 lines
251 B
Python
18 lines
251 B
Python
|
import time
|
||
|
|
||
|
from wraptor.context import throttle
|
||
|
|
||
|
def test_basic():
|
||
|
arr = []
|
||
|
t = throttle(.1)
|
||
|
|
||
|
with t:
|
||
|
arr.append(1)
|
||
|
with t:
|
||
|
arr.append(1)
|
||
|
time.sleep(.2)
|
||
|
with t:
|
||
|
arr.append(1)
|
||
|
|
||
|
assert arr == [1, 1]
|