Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
Corrige trata_entradas_tabela não sendo usada, corrige pesquisa_bolet…
Browse files Browse the repository at this point in the history
…im_data

trata_entradas_tabela estava sendo aplicada apenas para as tabelas de 23/03 e não para as demais; na pesquisa_boletim_data, o contador não estava sendo incrementado

Sobe versão
  • Loading branch information
AtilioA committed Apr 10, 2020
1 parent 773e0d3 commit 882ae15
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion COVID19_ES_Py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
'Boletim',
]

__version__ = "1.3.0"
__version__ = "1.3.1"
12 changes: 6 additions & 6 deletions COVID19_ES_Py/boletim.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ def pesquisa_boletim_data(self, data):
return Boletim(urljoin(DOMINIO_BOLETINS, linkBoletim))
else:
mainLogger.error( # pragma: no cover
f"Requisição falhou para {req.url}")
f"Requisição falhou para {req.url}")
i += 1
return None


Expand Down Expand Up @@ -366,6 +367,7 @@ def carrega_casos_19_03(self):
)
if elemento not in regioes
]
dadosLinha = trata_entradas_tabela(dadosLinha)
municipio = dadosLinha[0]

self.casos[municipio] = {
Expand Down Expand Up @@ -403,7 +405,7 @@ def carrega_casos_22_03(self):

# Exclui header (primeira linha) e total (última linha)
for linha in tabela[2:-2]:
dadosLinha = list(
dadosLinha = trata_entradas_tabela(
map(lambda linha: linha.text.strip(), linha.find_all("td")))

try:
Expand Down Expand Up @@ -447,10 +449,8 @@ def carrega_casos_23_03(self):

# Exclui header (primeira linha) e total (última linha)
for linha in tabela[1:-1]:
dadosLinha = list(
dadosLinha = trata_entradas_tabela(
map(lambda linha: linha.text.strip(), linha.find_all("p")))
dadosLinha = trata_entradas_tabela(dadosLinha)

municipio = dadosLinha[0]

self.casos[municipio] = {
Expand Down Expand Up @@ -480,7 +480,7 @@ def carrega_casos_04_04(self):

# Exclui header (primeira linha) e total (última linha)
for linha in tabela[1:-1]:
dadosLinha = list(
dadosLinha = trata_entradas_tabela(
map(lambda linha: linha.text.strip(), linha.find_all("td")))
municipio = dadosLinha[0]

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Atílio Antônio'

# The full version, including alpha/beta/rc tags
release = '1.3.0'
release = '1.3.1'

master_doc = 'index'

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="COVID19-ES-Py",
version="1.3.0",
version="1.3.1",
description="Scraper de boletins de casos de COVID-19 no Espírito Santo.",
long_description=README,
long_description_content_type="text/markdown",
Expand Down
8 changes: 4 additions & 4 deletions tests/test_carrega_casos_boletim.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from COVID19_ES_Py import Boletim, exceptions


# - TABELAS TIPO 1 (19_03)
# - TABELAS TIPO 1 (19/03/2020)
def test_boletim_21():
assert (
Boletim(
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_boletim_23():
)


# TABELA TIPO 2 (22_03)
# TABELA TIPO 2 (22/03/2020)
def test_boletim_24():
assert (
Boletim(
Expand Down Expand Up @@ -126,7 +126,7 @@ def test_boletim_24():
)


# TABELA TIPO 3 (23_03)
# TABELA TIPO 3 (23/03/2020)
def test_boletim_25():
assert (
Boletim(
Expand Down Expand Up @@ -367,7 +367,7 @@ def test_boletim_32():
)


# TABELA TIPO 4 (04_04)
# TABELA TIPO 4 (04/04/2020)
def test_boletim_37():
assert (
Boletim(
Expand Down

0 comments on commit 882ae15

Please sign in to comment.