Skip to content

Commit 3bd7729

Browse files
committed
more consistent with Pydantic interface
1 parent bbd1501 commit 3bd7729

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

File renamed without changes.

clabe/types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
str_validator,
88
)
99

10-
from . import exc
10+
from .errors import BankCodeValidationError, ClabeControlDigitValidationError
1111
from .validations import BANK_NAMES, BANKS, compute_control_digit
1212

1313
if TYPE_CHECKING:
@@ -47,13 +47,13 @@ def __get_validators__(cls) -> 'CallableGenerator':
4747
@classmethod
4848
def validate_bank_code_abm(cls, clabe: str) -> str:
4949
if clabe[:3] not in BANKS.keys():
50-
raise exc.BankCodeValidationError
50+
raise BankCodeValidationError
5151
return clabe
5252

5353
@classmethod
5454
def validate_control_digit(cls, clabe: str) -> str:
5555
if clabe[-1] != compute_control_digit(clabe):
56-
raise exc.ClabeControlDigitValidationError
56+
raise ClabeControlDigitValidationError
5757
return clabe
5858

5959
@property

clabe/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.1.1'
1+
__version__ = '1.2.0'

tests/test_types.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
from pydantic.errors import NotDigitError
44

55
from clabe import BANK_NAMES, BANKS, compute_control_digit
6-
from clabe.exc import BankCodeValidationError, ClabeControlDigitValidationError
6+
from clabe.errors import (
7+
BankCodeValidationError,
8+
ClabeControlDigitValidationError,
9+
)
710
from clabe.types import Clabe, validate_digits
811

912
VALID_CLABE = '646180157042875763'

0 commit comments

Comments
 (0)