From 277b368c041c9ed896856445309785e1b0921a17 Mon Sep 17 00:00:00 2001 From: Chris Fulljames Date: Sun, 30 Mar 2025 15:21:00 -0400 Subject: [PATCH] Fix online tests --- test/test_online.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_online.py b/test/test_online.py index 0d41802..6bc3474 100644 --- a/test/test_online.py +++ b/test/test_online.py @@ -1,11 +1,13 @@ import html import json import re +from pathlib import Path import requests import pytest HOST = "http://littlesong.place:8000" +TEST_DATA = Path(__file__).parent / "data" def url(path): return HOST + path @@ -29,7 +31,7 @@ def _get_song_list_from_page(page_contents): def test_upload_and_delete_song(s): response = s.post( url("/upload-song"), - files={"song-file": open("sample-3s.mp3", "rb")}, + files={"song-file": open(TEST_DATA/"sample-3s.mp3", "rb")}, data={ "title": "song title", "description": "song description", @@ -58,7 +60,7 @@ def test_comments_and_activity(s): # Upload song response = s.post( url("/upload-song"), - files={"song-file": open("sample-3s.mp3", "rb")}, + files={"song-file": open(TEST_DATA/"sample-3s.mp3", "rb")}, data={"title": "song title", "description": "", "tags": "", "collabs": ""}, ) response.raise_for_status() -- 2.39.5