See #261: Added a rate-limiting (throttling system) to limit the number of requests handled per user/IP
This commit is contained in:
parent
8666afc64f
commit
d28bf65d00
20 changed files with 1077 additions and 19 deletions
|
|
@ -5,6 +5,7 @@ import PIL
|
|||
import random
|
||||
import shutil
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
import factory
|
||||
import pytest
|
||||
|
|
@ -308,6 +309,13 @@ def now(mocker):
|
|||
return now
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def now_time(mocker):
|
||||
now = time.time()
|
||||
mocker.patch("time.time", return_value=now)
|
||||
return now
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def avatar():
|
||||
i = PIL.Image.new("RGBA", (400, 400), random.choice(["red", "blue", "yellow"]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue