Simplify BA code valdiation
This commit is contained in:
parent
52f577aea6
commit
27601300aa
@ -24,7 +24,7 @@ PE_REGEX = re.compile(
|
||||
|
||||
TREASURY_CODE_REGEX = re.compile(r"^0*([1-9]{4}|[1-9]{6})$")
|
||||
|
||||
BA_CODE_REGEX = re.compile(r"^0*[1-9]{2}\w?$")
|
||||
BA_CODE_REGEX = re.compile(r"[0-9]{2}\w?$")
|
||||
|
||||
|
||||
def suggest_pe_id(pe_id):
|
||||
|
@ -57,13 +57,19 @@ def test_treasury_code_validation(input_, expected):
|
||||
@pytest.mark.parametrize(
|
||||
"input_,expected",
|
||||
[
|
||||
("1", False),
|
||||
("12", True),
|
||||
("00012", True),
|
||||
("01", True),
|
||||
("0A", False),
|
||||
("A", False),
|
||||
("AB", False),
|
||||
("123", True),
|
||||
("012", True),
|
||||
("12A", True),
|
||||
("000123", True),
|
||||
("00012A", True),
|
||||
("0001", False),
|
||||
("00012AB", False),
|
||||
("02A", True),
|
||||
("0012", False),
|
||||
("012A", False),
|
||||
("2AB", False)
|
||||
],
|
||||
)
|
||||
def test_ba_code_validation(input_, expected):
|
||||
|
Loading…
x
Reference in New Issue
Block a user