This is a basic coding exercise created by the (UK) Cabinet Office.
(Please note, where python
is referred to, use python
or python3
as appropriate for your environment.)
Begin by cloning this repository. Next, change-directory to be in the coding-exercise folder and install dependencies:
python -m pip install -r requirements.txt
To run the application, you can do the following in the top-level exercise/ directory:
python manage.py runserver
You can then call the three endpoints (using either a web browser or a REST client application):
- /hello/
- /add-numbers/<first-number>/<second-number>/
- /join-words/<first-word>/<second-word>/
- /hello/
- Returns
Hello World
- Returns
- /add-numbers/10/20/
- Returns
30
- Returns
- /join-words/hello/there/
- Returns
hello-there
- Returns
You can run the test-suite (again in the top-level exercise/ directory) via:
python manage.py test tests/ --noinput
Original README and exercise-instructions are found in the original repo.