- Log in to GitHub.
- From the drop-down menu on the left, choose the
neumannrforganization. - Go to the
agile-tutorialrepository 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
cloneand select Git: Clone from the list. - Paste the
git@github.com:neumannrf/agile-tutorial.gitaddress 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
.editorconfigfile contains the standardisation of coding style. - The
.gitignorefile contains the names of the files to be ignore bygit. - The
.travis.ymlfile contains the build, test and deploy instructions for Travis CI. - The
LICENSEfile contains the standardApache-2.0open-source license. - The
Procfilefile contains the command required to launch the Cloud Foundry Application on IBM Cloud. - The
README.mdfile contains the welcome page and table of contents for the tutorial. - The
main.pyfile contains the Python code for the API resources. - The
manifest.ymlfile contains the definition of the Cloud Foundry Application on IBM Cloud. - The
requirements.txtfile contains the list of Python dependencies. - The
runtime.txtfile 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
defaultnamespace to expose its API resources. - Click the
/answerAPI 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-tutorialrepository in Visual Studio Code. - Open the
main.pyfile. - Read the code block associated with the
/answerresource and compare it to the live application.@api.route()defines the endpoint URL.@api.doc()provides the documentation.get()determines the HTTP method.returncalls 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-tutorialrepository in Visual Studio Code. - Open the
src/default_services.pyfile. - Read the code block associated with the
TheAnswerToLifeTheUniverseAndEverything()service and compare it to the live application.TheAnswerToLifeTheUniverseAndEverything()is the function name evoked in thereturnstatement of the/answerresource.- The documentation block explains the scope of the service and its input/output parameters.
return 42determines the Response body in the live application.
- Open the
agile-tutorialrepository in Visual Studio Code. - Open the
test/default_test.pyfile. - 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 dsincludes the external file containing the service to be tested.assertdetermines what is the expect behaviour for that service.