feat: is_valid_cpf by camilamaia · Pull Request #34 · brazilian-utils/python
Expand Up
@@ -8,7 +8,15 @@
path.insert(
1, abspath(join(dirname(abspath(getsourcefile(lambda: 0))), pardir))
)
from brutils.cpf import sieve, display, hashdigit, checksum, validate, generate
from brutils.cpf import (
sieve,
display,
hashdigit,
checksum,
validate,
generate,
is_valid_cpf,
)
from unittest import TestCase, main
Expand Down Expand Up @@ -42,6 +50,11 @@ def test_validate(self): assert validate("52599927765") assert not validate("00000000000")
def test_is_valid_cpf(self): assert is_valid_cpf("52513127765") assert is_valid_cpf("52599927765") assert not is_valid_cpf("00000000000")
def test_generate(self): for i in range(1000): assert validate(generate()) Expand Down
Expand Down Expand Up @@ -42,6 +50,11 @@ def test_validate(self): assert validate("52599927765") assert not validate("00000000000")
def test_is_valid_cpf(self): assert is_valid_cpf("52513127765") assert is_valid_cpf("52599927765") assert not is_valid_cpf("00000000000")
def test_generate(self): for i in range(1000): assert validate(generate()) Expand Down