v3.19.0 (docs/engine): test-script guide audit; sms da accepts a leading +
An audit of docs/test-scripts.md against the engine (testscript.py, events.py, the runner) found a handful of doc-level gaps, now fixed: - the scp80 param defaults (tar = the preset's ISD role TAR, spi1 = that TAR's MSL, spi2 = 01, kvn = the first keyset); - the counter rule as implemented: the run advances/persists the counter after every answered scp80 step when SPI1 requests a counter check (refused packets move the local value forward too - it only moves up); - respond is optional (an omitted object answers ok/0x00); - the run-log section: the exact READ BINARY/READ RECORD/UPDATE BINARY, SCP80 WRAPPED=/SP= and 'TEST-RUN step N failed:' lines; - Known limitations: an expanded-format 61xx has no in-packet GET RESPONSE (TS 102 226 5.2.1.1) - send the GET RESPONSE as a follow-up scp80 step; - sms check da: a leading + and whitespace are ignored. The engine now drops the + (the TPDU carries the international flag in the dialling type, so '+79...' could otherwise never match the parsed digits); docs/api.md and the local AGENTS note it. Tests: 821 frontend + 726 Python.
This commit is contained in:
@@ -276,6 +276,13 @@ class TestValidation(unittest.TestCase):
|
||||
self.assertEqual(sms['dcs'], {'mode': 'exact', 'value': '00'})
|
||||
self.assertEqual(sms['udl'], 5)
|
||||
self.assertEqual(sms['ud'], {'mode': 'mask', 'value': '0271??AABB'})
|
||||
# a leading '+' (the TPDU keeps the international flag in its
|
||||
# type-of-number) and whitespace are dropped from `da`
|
||||
script = T.normalise_script({'steps': [
|
||||
{'type': 'expect', 'command': 'SEND SHORT MESSAGE',
|
||||
'checks': [{'kind': 'sms', 'da': '+79 332 505 884'}]},
|
||||
]}, _resolver)
|
||||
self.assertEqual(script['steps'][0]['checks'][0]['da'], '79332505884')
|
||||
for check in ({'kind': 'alpha'}, # no value
|
||||
{'kind': 'alpha', 'mode': 'nope', 'value': 'x'},
|
||||
{'kind': 'sms'}, # no fields
|
||||
@@ -1075,7 +1082,7 @@ class TestRunnerActions(RunnerTestCase):
|
||||
'check': {'sw': {'mode': 'mask', 'value': '91??'}}},
|
||||
{'type': 'expect', 'command': 'SEND SHORT MESSAGE',
|
||||
'checks': [{'kind': 'alpha', 'mode': 'exact', 'value': 'Отправка...'},
|
||||
{'kind': 'sms', 'da': '79332505884', 'pid': '00',
|
||||
{'kind': 'sms', 'da': '+79 332 505 884', 'pid': '00',
|
||||
'dcs': '00', 'udl': 8, 'ud': '4B1C12579C9D83'}],
|
||||
'respond': {'result': 'ok'}},
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user