Skip to content

Show a list of movies on localhost:8000/movies/ from the Ghibli API

Notifications You must be signed in to change notification settings

thomie/kata-flask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This app shows a list of movies on localhost:8000/movies/ from the Ghibli API. For each movie, it lists the people that are in it.

Features:

  • Succesful calls to the Ghibli API are cached for 1 minute.
  • Returns HTTP 500 when unable to connect to the Ghibli API.
  • Requests to the Ghibli API time out after 10 seconds.
  • Extensive testsuite, without any use of Mock, MagicMock or patch.

Limitations:

  • Not threadsafe.
  • Request exceptions are not cached. So if the Ghibli API is down, we keep hitting it when the user refreshes (maybe this is a feature?).
  • Doesn't use the 'limit' parameter of the Ghibli API, because the API doesn't seem to support pagination anyway.

Run the server:

FLASK_DEBUG=1 FLASK_RUN_PORT=8000 flask run

Testing:

pytest test.py -s

Development:

Run black8 for pep8-compliance (with default settings, so 88 max line length).

About

Show a list of movies on localhost:8000/movies/ from the Ghibli API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published