- Log in to GitHub.
- From the drop-down menu on the left, choose the
neumannrf
organization. - Go to the
agile-tutorial
repository page. - Click the green button Clone or download and copy the address
git@github.com:neumannrf/agile-tutorial.git
. - Open Visual Studio Code and summon the Command Palette with
- Type
clone
and select Git: Clone from the list. - Paste the
git@github.com:neumannrf/agile-tutorial.git
address and select the destination. - Open the newly cloned repository.
- The
.github/
folder contains the templates used when a new issue or pull request is created. - The
docs/
folder contains the step-by-step instructions for the tutorial. - The
src/
folder contains the Python code for the API services. - The
test/
folder contains the Python code for the API tests. - The
.editorconfig
file contains the standardisation of coding style. - The
.gitignore
file contains the names of the files to be ignore bygit
. - The
.travis.yml
file contains the build, test and deploy instructions for Travis CI. - The
LICENSE
file contains the standardApache-2.0
open-source license. - The
Procfile
file contains the command required to launch the Cloud Foundry Application on IBM Cloud. - The
README.md
file contains the welcome page and table of contents for the tutorial. - The
main.py
file contains the Python code for the API resources. - The
manifest.yml
file contains the definition of the Cloud Foundry Application on IBM Cloud. - The
requirements.txt
file contains the list of Python dependencies. - The
runtime.txt
file contains Python version to be used by the Cloud Foundry Application on IBM Cloud.
- Open the http://agile-tutorial.mybluemix.net/ application in a browser.
- Click the
default
namespace to expose its API resources. - Click the
/answer
API resources to expose its documentation. - Click the Try it out button and then Execute.
- Confirm if the Response body contains the correct answer.
- Open the
agile-tutorial
repository in Visual Studio Code. - Open the
main.py
file. - Read the code block associated with the
/answer
resource and compare it to the live application.@api.route()
defines the endpoint URL.@api.doc()
provides the documentation.get()
determines the HTTP method.return
calls an external service located insrc/default_services.py
.
- Note how an external file was included by
from src import default_services as ds
.
- Open the
agile-tutorial
repository in Visual Studio Code. - Open the
src/default_services.py
file. - Read the code block associated with the
TheAnswerToLifeTheUniverseAndEverything()
service and compare it to the live application.TheAnswerToLifeTheUniverseAndEverything()
is the function name evoked in thereturn
statement of the/answer
resource.- The documentation block explains the scope of the service and its input/output parameters.
return 42
determines the Response body in the live application.
- Open the
agile-tutorial
repository in Visual Studio Code. - Open the
test/default_test.py
file. - Read the code block associated with the
test_answer()
test and compare it to the Travis CI build log.from src import default_services as ds
includes the external file containing the service to be tested.assert
determines what is the expect behaviour for that service.