Skip to content

charlttsie/open-library-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 Open Library API test suite

Automated API test suite for the Open Library API, built with Python and pytest.

Testing scope

Endpoints covered in the tests:

Search (/search.json)

  • Results returned for title and author queries
  • Empty query handling
  • Schema validation (title, author_name, first_publish_year field types)
  • Content-Type header
  • Response time < 5s

Books (/works/{id}.json)

  • 200 for valid IDs, 404 for invalid
  • Required field: title is a non-empty string
  • Optional field: description presence
  • Content-Type header

Authors (/authors/{id}.json)

  • 200 for valid IDs, 404 for invalid
  • Required field: name is a non-empty string
  • Optional field: birth_date presence
  • Content-Type header

Markers

  • smoke — fast sanity checks for critical paths
  • schema — field type and structure validation
  • slow — network-sensitive tests (response time)

Tech stack

  • Python 3
  • pytest
  • requests
  • pytest-html for reporting

Setup

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Run the tests

# All tests
pytest -v

# Smoke only
pytest -v -m smoke

# Schema only
pytest -v -m schema

# Skip slow tests
pytest -v -m "not slow"

# HTML report
pytest -v --html=report.html --self-contained-html

About

Automated API test suite for the Open Library API, built with Python and pytest.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages