Internal service used to calculate exchange rates using fxdata as it's cache/data layer
make testcurrent total coverage is 73%
$ make coverage
pytest --cov=app tests/
=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.8.5, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/aaron/Desktop/Projects/fxservice
plugins: cov-2.11.1
collected 2 items
tests/test_fxconvert.py .. [100%]
----------- coverage: platform linux, python 3.8.5-final-0 -----------
Name Stmts Miss Cover
-------------------------------------------
app/__init__.py 0 0 100%
app/app.py 33 10 70%
app/utils/__init__.py 0 0 100%
app/utils/convert.py 3 0 100%
app/utils/extract.py 20 11 45%
app/utils/response.py 25 1 96%
-------------------------------------------
TOTAL 81 22 73%
re-format's code to PEP 8 standard
make formatmake buildDeploy using docker-compose
docker-compose upcurl http://fxconvert/convert?from=GBP&to=USD&amount=1&date=2021-03-09if successful the command should return
{
"success": true,
"query": {
"from": "GBP",
"to": "USD",
"amount": 1
},
"date": "2021-03-09",
"rate": 1.2,
"result": 1.20
}