From 244298ef5e95c9ed52b4467aed4d69f955856168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Felipe=20Mil=C3=A9o?= Date: Tue, 16 Jul 2024 18:54:58 -0300 Subject: [PATCH] [REF] tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luis Felipe Miléo --- .appveyor.yml | 46 ------------------------- .github/workflows/python-package.yml | 2 +- src/erpbrasil/edoc/pdf/danfe_formata.py | 2 +- tests/test_xml.py | 13 +++---- 4 files changed, 9 insertions(+), 54 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 00e9fae..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,46 +0,0 @@ -version: '{branch}-{build}' -build: off -cache: - - '%LOCALAPPDATA%\pip\Cache' -environment: - global: - WITH_COMPILER: 'cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd' - matrix: - - TOXENV: check - TOXPYTHON: C:\Python37\python.exe - PYTHON_HOME: C:\Python37 - PYTHON_VERSION: '3.7' - PYTHON_ARCH: '32' - - TOXENV: 'py37,codecov' - TOXPYTHON: C:\Python37\python.exe - PYTHON_HOME: C:\Python37 - PYTHON_VERSION: '3.7' - PYTHON_ARCH: '32' - - TOXENV: 'py37,codecov' - TOXPYTHON: C:\Python37-x64\python.exe - PYTHON_HOME: C:\Python37-x64 - PYTHON_VERSION: '3.7' - PYTHON_ARCH: '64' -init: - - ps: echo $env:TOXENV - - ps: ls C:\Python* -install: - - python -u ci\appveyor-bootstrap.py - - python -m pip install -U pip - - '%PYTHON_HOME%\Scripts\virtualenv --version' - - '%PYTHON_HOME%\Scripts\easy_install --version' - - '%PYTHON_HOME%\Scripts\pip --version' - - '%PYTHON_HOME%\Scripts\tox --version' - - choco install -r -y swig -test_script: - - '%WITH_COMPILER% %PYTHON_HOME%\Scripts\tox' - -on_failure: - - ps: dir "env:" - - ps: get-content .tox\*\log\* -artifacts: - - path: dist\* - -### To enable remote debugging uncomment this (also, see: http://www.appveyor.com/docs/how-to/rdp-to-build-worker): -# on_finish: -# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 6cd9eca..0ce3153 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.5", "3.8", "3.10"] + python-version: ["3.8", "3.10"] steps: - uses: actions/checkout@v4 diff --git a/src/erpbrasil/edoc/pdf/danfe_formata.py b/src/erpbrasil/edoc/pdf/danfe_formata.py index dfa5a5e..a1e4414 100644 --- a/src/erpbrasil/edoc/pdf/danfe_formata.py +++ b/src/erpbrasil/edoc/pdf/danfe_formata.py @@ -145,7 +145,7 @@ def formata_dhRecbto(dhRecbto): # FIXME em algum ponto o valor do campo esta sendo formatado para string # deveria ter um tratamento caso o valor seja None deveria retornar a string # vazia '' ao invés de retornar 'None' - if dhRecbto is 'None': + if dhRecbto == 'None': return '' else: dhRecbto = str(dhRecbto) diff --git a/tests/test_xml.py b/tests/test_xml.py index a26d3ab..53914e3 100644 --- a/tests/test_xml.py +++ b/tests/test_xml.py @@ -7,10 +7,11 @@ OUTPUT = 'output' TIPO = 'danfe' -for (dirpath, dirnames, filenames) in walk(PATH): - for file in filenames: - arquivo = path.join(PATH, file) - output = path.join(OUTPUT, file) +def test_pdf_gen(): + for (dirpath, dirnames, filenames) in walk(PATH): + for file in filenames: + arquivo = path.join(PATH, file) + output = path.join(OUTPUT, file) - print('XML: ' + file) - print(base.ImprimirXml.imprimir(caminho_xml=arquivo, output_dir=output)) + print('XML: ' + file) + print(base.ImprimirXml.imprimir(caminho_xml=arquivo, output_dir=output))