-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Conversation
There was a problem hiding this 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?
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. |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
é dificil, mas o pior é que pode kkkk 😵💫 pesquisei alguns casos:
1: https://www.apontador.com.br/cep/11111111#:~:text=O%20que%20tem%20no%20CEP,Centro%2C%20Estncia%2C%20SE%20%2D%20Apontador
2: https://www.apontador.com.br/cep/22222222#:~:text=O%20que%20tem%20no%20CEP,I%2C%20Araraquara%2C%20SP%20%2D%20Apontador
9:
https://consultarcep.com/endereco/99999999/avenida-das-torres
There was a problem hiding this comment.
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 Report
@@ Coverage Diff @@
## main #123 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 4 +1
Lines 65 69 +4
=========================================
+ Hits 65 69 +4
|
Criando a nova feature para CEP:
cep.py
etest_cep.py
is_valid_cep
closes #119