Skip to content

Commit

Permalink
feat: tests and __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nataliagranato committed Mar 20, 2024
1 parent 582997b commit 2d6da1d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
17 changes: 12 additions & 5 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
from analise_de_custos import get_custom_date_range, list_costs_by_service
"""
Este é o módulo principal do projeto aws_cost_py.
Ele importa e executa as funções do módulo analise_de_custos.
"""

from .analise_de_custos import get_custom_date_range, list_costs_by_service

def main():
"""
Função principal que solicita ao usuário um intervalo de datas e lista os custos dos serviços AWS para esse intervalo.
"""
start_date, end_date = get_custom_date_range()
if start_date and end_date:
list_costs_by_service(start_date, end_date)
list_costs_by_service(start_date, end_date)

if __name__ == '__main__':
main()
if __name__ == "__main__":
main()
Binary file removed __pycache__/analise_de_custos.cpython-311.pyc
Binary file not shown.
16 changes: 14 additions & 2 deletions tests/test_analise_de_custos.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
"""
Este é o módulo de teste para o módulo analise_de_custos.
Ele contém testes unitários para as funções get_custom_date_range e list_costs_by_service.
"""

import unittest
from analise_de_custos import get_custom_date_range, list_costs_by_service
from analise_de_custos import get_custom_date_range

class TestAnaliseDeCustos(unittest.TestCase):
"""
Esta classe contém testes unitários para o módulo analise_de_custos.
"""

def test_get_custom_date_range_valid_input(self):
start_date, end_date = get_custom_date_range()
"""
Testa a função get_custom_date_range com uma entrada válida.
"""
input_start_date, input_end_date = get_custom_date_range()

0 comments on commit 2d6da1d

Please sign in to comment.