From 582997b18e69b89a0c071c704066ecdbab0f4d42 Mon Sep 17 00:00:00 2001 From: nataliagranato Date: Wed, 20 Mar 2024 11:51:11 -0300 Subject: [PATCH] feat: tests and __init__.py --- .gitignore | 2 ++ README.md | 14 ++++++++++ __init__.py | 9 +++++++ __pycache__/analise_de_custos.cpython-311.pyc | Bin 0 -> 3283 bytes analise-de-custos.py => analise_de_custos.py | 25 +++++++++++++++--- tests/test_analise_de_custos.py | 6 +++++ 6 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 __init__.py create mode 100644 __pycache__/analise_de_custos.cpython-311.pyc rename analise-de-custos.py => analise_de_custos.py (76%) create mode 100644 tests/test_analise_de_custos.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3454843 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +tests/__pycache__ +.vscode \ No newline at end of file diff --git a/README.md b/README.md index c714956..a779e9e 100644 --- a/README.md +++ b/README.md @@ -31,4 +31,18 @@ Para executar o script, você pode usar o seguinte comando: python3 analise-de-custos.py ``` +Ou + +``` +python3 -m analise_de_custos +``` + O script irá solicitar que você insira as datas de início e término para a análise de custos. As datas devem ser inseridas no formato AAAA-MM-DD. Em seguida, o script irá listar os custos dos serviços AWS para o período de tempo especificado. + +## Extras + +- 1. **Executando o teste**: + +``` +python3 -m unittest tests.test_analise_de_custos +``` diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..650bc0d --- /dev/null +++ b/__init__.py @@ -0,0 +1,9 @@ +from analise_de_custos import get_custom_date_range, list_costs_by_service + +def main(): + start_date, end_date = get_custom_date_range() + if start_date and end_date: + list_costs_by_service(start_date, end_date) + +if __name__ == '__main__': + main() diff --git a/__pycache__/analise_de_custos.cpython-311.pyc b/__pycache__/analise_de_custos.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd10e7f1396cbce847bf8f137f697a38cfec2489 GIT binary patch literal 3283 zcmbVO&2QVt6(35ZM9H!hn`UBJiNnH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