diff options
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 70bbd37..0072f26 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ """Set up fixtures for tests""" +import io import os import socket import subprocess @@ -38,3 +39,8 @@ def client(redis_server): # pylint: disable=[redefined-outer-name] "REDIS_URL": redis_server }) yield app.test_client() + +def uploadable_file_object(filename): + "Return an 'object' representing the file to be uploaded." + with open(f"tests/test_data/{filename}", "br") as the_file: + return (io.BytesIO(the_file.read()), filename) |