Skip to content

Commit

Permalink
feat(issue-63): Translate comments to portuguese and remove non used if
Browse files Browse the repository at this point in the history
  • Loading branch information
Douglas019BR committed Aug 14, 2024
1 parent 68d946d commit 9f267cb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion tests/test_CPF.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ def test_add_leading_zeros(self):
for cpf_input, expected_output in cases:
self.assertEqual(self.cpf._complete_with_zeros(cpf_input), expected_output)

# Test if the input is already correct length, it should not add zeros
# Testa se a entrada ja tem o tamanho correto, não deve adicionar zeros
self.assertEqual(self.cpf._complete_with_zeros('00123456789'), '00123456789')
self.assertEqual(self.cpf._complete_with_zeros('23456789012'), '23456789012')
3 changes: 0 additions & 3 deletions validate_docbr/CPF.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ def validate(self, doc: str = '') -> bool:

if len(doc) != 11:
doc = self._complete_with_zeros(doc)
if len(doc) != 11:
return False

if not self.repeated_digits and self._check_repeated_digits(doc):
return False
Expand Down Expand Up @@ -81,5 +79,4 @@ def _check_repeated_digits(self, doc: List[str]) -> bool:

def _complete_with_zeros(self, doc: list[str]) -> list[str]:
"""Adiciona zeros a esquerda para completar o CPF."""

return '0' * (11 - len(doc)) + str(doc)

0 comments on commit 9f267cb

Please sign in to comment.