diff options
author | Frederick Muriuki Muriithi | 2022-06-16 13:33:31 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-06-16 13:33:31 +0300 |
commit | c6b182d346dcf6d3b1cb98956aa3066067f00757 (patch) | |
tree | 4f40b729aea86ce8da93fa4da6244d186f0e87c1 /tests/conftest.py | |
parent | d2605cb72d7cdbc7d3cc633b94a451c0acd2edbb (diff) | |
download | gn-uploader-c6b182d346dcf6d3b1cb98956aa3066067f00757.tar.gz |
Add more UI tests
- Test upload with missing or invalid data
- Test triggering the parsing of the file
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) |