From 6765f8608d98ef5236f00afc87db5b941721ab63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Augusto=20de=20Sousa=20C=C3=A2mara?= Date: Tue, 3 Sep 2024 19:24:29 -0300 Subject: [PATCH] arquivos de teste dos algoritimos --- web/Bases web/jsons/_test_compras_automatico.py | 10 ++++++++++ web/Bases web/jsons/_test_convenio_automatico.py | 10 ++++++++++ web/Bases web/jsons/_test_credito_automatico.py | 10 ++++++++++ web/Bases web/jsons/_test_licitacoes_automatico.py | 13 +++++++++++++ web/Bases web/jsons/_test_verbas_automatico.py | 13 +++++++++++++ 5 files changed, 56 insertions(+) create mode 100644 web/Bases web/jsons/_test_compras_automatico.py create mode 100644 web/Bases web/jsons/_test_convenio_automatico.py create mode 100644 web/Bases web/jsons/_test_credito_automatico.py create mode 100644 web/Bases web/jsons/_test_licitacoes_automatico.py create mode 100644 web/Bases web/jsons/_test_verbas_automatico.py diff --git a/web/Bases web/jsons/_test_compras_automatico.py b/web/Bases web/jsons/_test_compras_automatico.py new file mode 100644 index 00000000..82ce0370 --- /dev/null +++ b/web/Bases web/jsons/_test_compras_automatico.py @@ -0,0 +1,10 @@ +import pytest +from compras_automatico import fetch_and_process_data + +def test_process_gazettes_execution(): + try: + fetch_and_process_data('2024-01-01', '2024-01-02') + assert True # Se não houver exceções, o teste passa + except Exception as e: + pytest.fail(f"process_gazettes falhou com a exceção: {e}") + diff --git a/web/Bases web/jsons/_test_convenio_automatico.py b/web/Bases web/jsons/_test_convenio_automatico.py new file mode 100644 index 00000000..8bc922c7 --- /dev/null +++ b/web/Bases web/jsons/_test_convenio_automatico.py @@ -0,0 +1,10 @@ +import pytest +from convenio_automatico import process_gazettes + +def test_process_gazettes_execution(): + try: + process_gazettes() + assert True # Se não houver exceções, o teste passa + except Exception as e: + pytest.fail(f"process_gazettes falhou com a exceção: {e}") + diff --git a/web/Bases web/jsons/_test_credito_automatico.py b/web/Bases web/jsons/_test_credito_automatico.py new file mode 100644 index 00000000..10ffa8fc --- /dev/null +++ b/web/Bases web/jsons/_test_credito_automatico.py @@ -0,0 +1,10 @@ +import pytest +from credito_automatico import process_gazettes + +def test_process_gazettes_execution(): + try: + process_gazettes() + assert True # Se não houver exceções, o teste passa + except Exception as e: + pytest.fail(f"process_gazettes falhou com a exceção: {e}") + diff --git a/web/Bases web/jsons/_test_licitacoes_automatico.py b/web/Bases web/jsons/_test_licitacoes_automatico.py new file mode 100644 index 00000000..346565fe --- /dev/null +++ b/web/Bases web/jsons/_test_licitacoes_automatico.py @@ -0,0 +1,13 @@ +import pytest +import os + +# Caminho do script a ser testado +script_path = os.path.join(os.path.dirname(__file__), 'licitacoes_automatico.py') + +def test_script_execution(): + try: + # Executa o script como um módulo para garantir que ele não gera exceções + exec(open(script_path).read()) + assert True # Se não houver exceções, o teste passa + except Exception as e: + pytest.fail(f"O script falhou com a exceção: {e}") diff --git a/web/Bases web/jsons/_test_verbas_automatico.py b/web/Bases web/jsons/_test_verbas_automatico.py new file mode 100644 index 00000000..e96146b5 --- /dev/null +++ b/web/Bases web/jsons/_test_verbas_automatico.py @@ -0,0 +1,13 @@ +import pytest +import os + +# Caminho do script a ser testado +script_path = os.path.join(os.path.dirname(__file__), 'verbas_automatico.py') + +def test_script_execution(): + try: + # Executa o script como um módulo para garantir que ele não gera exceções + exec(open(script_path).read()) + assert True # Se não houver exceções, o teste passa + except Exception as e: + pytest.fail(f"O script falhou com a exceção: {e}")