修复:严格校验测试批次请求头

This commit is contained in:
焦龙言
2026-09-22 15:30:28 +08:00
parent 763ea1efcc
commit e396fff790
2 changed files with 8 additions and 4 deletions
@@ -82,6 +82,11 @@ class TestBatchHeaderTest(unittest.TestCase):
with self.subTest(raw=raw), self.assertRaisesRegex(ServiceWarning, '测试批次标识必须为正整数'):
parse_optional_positive_batch_id(raw)
def test_python_coercible_values_are_not_valid_ascii_decimal_literals(self) -> None:
for raw in (' 7', '7 ', '+7', '1_0', '7', True, 7, b'7'):
with self.subTest(raw=raw), self.assertRaisesRegex(ServiceWarning, '测试批次标识必须为正整数'):
parse_optional_positive_batch_id(raw)
class TestBatchAccessTest(unittest.IsolatedAsyncioTestCase):
async def asyncSetUp(self) -> None: