Skip to content

Add regression test for GetData timeout parsing (#9)#61

Merged
itg-karthicr merged 2 commits into
masterfrom
test/getdata-timeout-regression
Jun 24, 2026
Merged

Add regression test for GetData timeout parsing (#9)#61
itg-karthicr merged 2 commits into
masterfrom
test/getdata-timeout-regression

Conversation

@itg-karthicr

Copy link
Copy Markdown
Contributor

Closes #9

Summary

Issue #9 reported that a GetData timeout raised AGINoResultError. Asterisk replies result= (timeout) (empty value, then the parenthetical), and the old KV regex required a non-empty value.

It was already fixed in 12c4bd7 (2014, Neil Tallim, "Fix for i9") by making the value group optional. The issue was migrated from Google Code and never closed, and the behavior had no test. This adds regression coverage so it cannot silently break again.

Tests (tests/test_agi_core.py)

  • test_getdata_timeout_result_parses_without_error200 result= (timeout) parses to value "" / data "timeout", no AGINoResultError.
  • test_getdata_process_response_flags_timeoutGetData.process_response returns ("", True) on timeout.
  • test_getdata_process_response_returns_digits — returns ("1234", False) for normal input.

No code change (the fix predates this by ~12 years) and no changelog entry (nothing user-facing changed in this release). Suite: 40 passed.

🤖 Generated with Claude Code

itg-karthicr and others added 2 commits June 24, 2026 19:03
Issue #9 reported that a GetData timeout ("result= (timeout)") raised
AGINoResultError. It was fixed in 12c4bd7 (2014) by making the value
group optional in the KV regex, but the migrated issue was never closed
and the behavior was untested.

Add regression tests pinning it: the empty-value-with-data parse, and
GetData.process_response returning ("", True) on timeout and
("<digits>", False) otherwise.

Closes #9
Cover the common real-world GetData timeout where a caller enters some
digits before the inter-digit timer expires. Asterisk replies
"result=12 (timeout)", and process_response must return both the
collected digits and the timeout flag. Pins the value/data split that
the existing empty-value and no-timeout cases do not exercise together.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@itg-karthicr itg-karthicr merged commit b40c078 into master Jun 24, 2026
8 checks passed
@itg-karthicr itg-karthicr deleted the test/getdata-timeout-regression branch June 24, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GetData timeout raises an AGINoResultError

1 participant