Skip to content

Conversation

@antoniamaia
Copy link
Member

@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

@antoniamaia antoniamaia requested a review from camilamaia July 5, 2023 10:03
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
Member 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
@antoniamaia antoniamaia requested a review from camilamaia July 8, 2023 09:51
@camilamaia camilamaia merged commit 4cd0ed2 into brazilian-utils:main Jul 8, 2023
@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