Skip to content

Commit fa2b910

Browse files
committed
feat(issue63):Translate comments to portuguese and remove non used if
1 parent 64e6a7b commit fa2b910

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

tests/test_CPF.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ def test_add_leading_zeros(self):
6767
for cpf_input, expected_output in cases:
6868
self.assertEqual(self.cpf._complete_with_zeros(cpf_input), expected_output)
6969

70-
# Test if the input is already correct length, it should not add zeros
70+
# Testa se a entrada ja tem o tamanho correto, não deve adicionar zeros
7171
self.assertEqual(self.cpf._complete_with_zeros('00123456789'), '00123456789')
7272
self.assertEqual(self.cpf._complete_with_zeros('23456789012'), '23456789012')

validate_docbr/CPF.py

-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ def validate(self, doc: str = '') -> bool:
2020

2121
if len(doc) != 11:
2222
doc = self._complete_with_zeros(doc)
23-
if len(doc) != 11:
24-
return False
2523

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

8280
def _complete_with_zeros(self, doc: list[str]) -> list[str]:
8381
"""Adiciona zeros a esquerda para completar o CPF."""
84-
8582
return '0' * (11 - len(doc)) + str(doc)

0 commit comments

Comments
 (0)