Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Validação CEP #123

Merged
merged 6 commits into from
Jul 8, 2023
Merged

Feature: Validação CEP #123

merged 6 commits into from
Jul 8, 2023

Conversation

antoniamaia
Copy link
Contributor

@antoniamaia antoniamaia commented Jul 5, 2023

Criando a nova feature para CEP:

  • criação dos arquivos cep.py e test_cep.py
  • atualização da documentação
  • criando a função e seu respectivo teste is_valid_cep

closes #119

Copy link
Member

@camilamaia camilamaia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uma dica para tentar resolver o erro que está acontecendo nos testes é: joga a mensagem de erro no Google.

AttributeError: 'int' object has no attribute 'isdigit'

Tenta dar uma olhada, uma fuçada. Senão ficar claro, eu te ajudo mais diretamente daí. Que tal?

Comment on lines +14 to +16
Returns when CEP is valid, input should be a digit
string of proper length. Doesn't validate if it's real,
'cause only the "Correios" Base does.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esse disclaimer podia estar na documentação (READMEs) também. O quê achas? Assim a pessoa que for utilizar já fica ciente de como a função funciona.



class CEP(TestCase):
def test_is_valid(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏👏👏

assert not is_valid("1234567-")

# When CEP is valid
assert is_valid("99999999")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um CEP pode ter tudo o mesmo número?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caraca, que loucura!! Deve ser bem bom para decorar hahah

@codecov
Copy link

codecov bot commented Jul 8, 2023

Codecov Report

Merging #123 (5bcac91) into main (7a3249d) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #123   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         4    +1     
  Lines           65        69    +4     
=========================================
+ Hits            65        69    +4     
Impacted Files Coverage Δ
brutils/__init__.py 100.00% <100.00%> (ø)
brutils/cep.py 100.00% <100.00%> (ø)

@antoniamaia antoniamaia marked this pull request as ready for review July 8, 2023 09:50
@camilamaia camilamaia merged commit 4cd0ed2 into brazilian-utils:main Jul 8, 2023
8 checks passed
@camilamaia camilamaia mentioned this pull request Jul 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validação de CEPs
2 participants