This project contains automated tests for the Star Wars API (SWAPI), focusing on validating the responses from various endpoints such as planets, characters, and starships. It utilizes Python and pytest to ensure that the API delivers accurate data structures and behaves as expected.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
What you need to install the software:
- Python 3.8 or higher
- pip (Python package manager)
- Clone the Repository
After cloning the repository, setting up your virtual environment, and installing the dependencies, you're ready to run the automated tests for this project. Follow these steps:
-
Navigate to the Project Directory
Ensure you're in the root directory of the project where the
pytest
tests are located.cd path/to/star_wars_api
-
Activate the Virtual Environment
Before running the tests, make sure your virtual environment is activated. This ensures you're using the correct Python and dependencies versions for the project.
- On macOS/Linux:
source venv/bin/activate
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
-
Run the Tests
With your virtual environment activated, use
pytest
to run all tests:pytest
This command will discover and execute all test files within the project directory that follow the
test_*.py
naming convention.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Thanks to the Star Wars API (SWAPI) for providing a fun and accessible API to work with.
- Appreciation for the pytest team for their excellent testing framework.