feat: account code extraction with zero-padding
This commit is contained in:
@@ -14,3 +14,26 @@ class TestParseOptions:
|
||||
|
||||
def test_flag_without_value(self):
|
||||
assert kyofilter.parse_options("SomeFlag") == {"SomeFlag": "true"}
|
||||
|
||||
|
||||
class TestGetAccountCode:
|
||||
def test_five_digit_code_zero_padded_to_eight(self):
|
||||
assert kyofilter.get_account_code({"KmManagment": "MG12345"}) == "00012345"
|
||||
|
||||
def test_one_digit_code_zero_padded(self):
|
||||
assert kyofilter.get_account_code({"KmManagment": "MG1"}) == "00000001"
|
||||
|
||||
def test_eight_digit_code_unchanged(self):
|
||||
assert kyofilter.get_account_code({"KmManagment": "MG12345678"}) == "12345678"
|
||||
|
||||
def test_default_returns_none(self):
|
||||
assert kyofilter.get_account_code({"KmManagment": "Default"}) is None
|
||||
|
||||
def test_missing_key_returns_none(self):
|
||||
assert kyofilter.get_account_code({}) is None
|
||||
|
||||
def test_no_mg_prefix_returns_none(self):
|
||||
assert kyofilter.get_account_code({"KmManagment": "12345"}) is None
|
||||
|
||||
def test_non_numeric_code_returns_none(self):
|
||||
assert kyofilter.get_account_code({"KmManagment": "MGabc45"}) is None
|
||||
|
||||
Reference in New Issue
Block a user