1.5 KiB
Spotizerr Backend Tests
This directory contains automated tests for the Spotizerr backend API.
Prerequisites
-
Running Backend: Ensure the Spotizerr Flask application is running and accessible at
http://localhost:7171. You can start it withpython app.py. -
Python Dependencies: Install the necessary Python packages for testing.
pip install pytest requests python-dotenv -
Credentials: These tests require valid Spotify and Deezer credentials. Create a file named
.envin the root directory of the project (spotizerr) and add your credentials to it. The tests will load this file automatically.Example
.envfile:SPOTIFY_API_CLIENT_ID="your_spotify_client_id" SPOTIFY_API_CLIENT_SECRET="your_spotify_client_secret" # This should be the full JSON content of your credentials blob as a single line string SPOTIFY_BLOB_CONTENT='{"username": "your_spotify_username", "password": "your_spotify_password", ...}' DEEZER_ARL="your_deezer_arl"The tests will automatically use these credentials to create and manage test accounts named
test-spotify-accountandtest-deezer-account.
Running Tests
To run all tests, navigate to the root directory of the project (spotizerr) and run pytest:
pytest
To run a specific test file:
pytest tests/test_downloads.py
For more detailed output, use the -v (verbose) and -s (show print statements) flags:
pytest -v -s