Absolutely — I’ll rebuild the entire README.md with clean formatting, proper spacing, headings, icons, consistent style, and great readability for GitHub.
This version is copy-paste ready, fully structured, and looks professional + human-written.
A compact Python project for API testing, offline test design, and generating weather cards — powered by CI.
This project originally started as a tiny API testing sandbox and gradually evolved into a practical, hands-on QA mini-framework. It now includes:
- ✔️ Live API tests against the Weatherstack service
- ✔️ Resilient test behavior (auto-skip on 401, rate-limits, etc.)
- ✔️ Offline tests (no network required)
- ✔️ A PNG weather card generator
- ✔️ GitHub Actions CI with HTML test reports + generated images
It’s intentionally lightweight, readable, and useful both as a personal lab and as a portfolio piece for QA/SDET roles.
| Component | Purpose |
|---|---|
| Python 3.12 | Base language |
| pytest | Test runner |
| requests | HTTP client |
| responses | Offline mocking |
| Pillow (PIL) | Weather card PNG creation |
| GitHub Actions | CI pipeline |
No heavy frameworks — everything is simple and dependency-minimal.
git clone https://github.com/LaidonerS/api-testing-lab
cd api-testing-labpython3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtCreate a free account at: https://weatherstack.com/
Then export your key:
export WEATHERSTACK_API_KEY="your_real_key_here"Verify:
echo $WEATHERSTACK_API_KEYIf it prints your key, you’re good to go.
pytest -vpytest -k offline -vpytest -k "weather and not offline" -vWeather APIs love to throw:
401 Unauthorized429 rate_limit_reached{"success": false, "error": ...}
This project automatically skips tests when those happen, so your CI stays green and readable.
This project includes a script that grabs the current weather and renders it into a simple PNG “card.”
Run it like this:
export WEATHERSTACK_API_KEY="your_key"
CITY="Bangkok" python generate_weather_image.pyYou will get:
weather_Bangkok.png
The card includes:
- City & country
- Temperature and “feels like”
- Weather description
- Humidity
- Background color based on temperature category
It’s a small feature, but surprisingly handy for dashboards or quick-sharing.
api-testing-lab/
│
├── utils/
│ ├── api_client.py # Auth + GET wrapper for Weatherstack
│ └── weather_models.py # WeatherSnapshot model + temp categories
│
├── tests/
│ ├── test_weather_current.py # Live API tests
│ ├── test_weather_parsing_offline.py # Offline JSON structure tests
│ └── test_weather_models_offline.py # Model & categorization tests
│
├── generate_weather_image.py # PNG weather card generator
│
├── .github/workflows/tests.yml # CI pipeline
└── requirements.txt # Dependencies
Each piece is intentionally kept small and straightforward.
Every push to main automatically triggers:
-
Dependency installation
-
pytest execution (with HTML report)
-
Weather card generation
-
Artifact upload:
report.htmlweather_<city>.png
To enable CI, set the repo secret:
WEATHERSTACK_API_KEY
Path: GitHub → Settings → Secrets and Variables → Actions
You can download CI artifacts under: Actions → select a run → Artifacts
A real API means real problems:
- Authentication failures
- Rate limiting
- Odd error structures
- Occasional city mismatches
- Network variance
This makes it a perfect API for practicing robust test automation — not the “clean textbook” examples, but the messy real stuff.
Some potential next steps:
- Add async tests using
httpx - Add Playwright UI tests for viewing weather cards
- Create a CLI tool:
weathercli London - Add caching or retry logic
- Generate weekly trend charts
- Build a tiny FastAPI wrapper around WeatherSnapshot
This repo is intentionally flexible — easy to grow if you want more challenges.
This project aims to be:
- Authentic
- Practical
- Easy to read
- Demonstrative of real-world API testing challenges
- Useful as a QA/SDET portfolio reference
If you'd like help expanding it, polishing it further, or adding advanced features, just ask — happy to guide you through the next steps!
If you want a “badge section” (build passing ✨), screenshots, or a more playful intro, I can add those too.