-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds tests for the EndIf application reflecting previously broken behavior.
- Loading branch information
1 parent
90ec44a
commit 09a501f
Showing
6 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[default] | ||
exten => s,1,Answer() | ||
same => n,If(1) | ||
same => n,NoOp(inside main if) | ||
same => n,If(0) | ||
same => n,NoOp() | ||
same => n,EndIf() | ||
same => n,NoOp(after nested false if) | ||
same => n,If(1) | ||
same => n,NoOp(inside true nested if) | ||
same => n,EndIf() | ||
same => n,NoOp(after nested true if) | ||
; Test success: we exited only the inside If, not the outside If | ||
same => n,UserEvent(IfSuccess,Result: Pass) | ||
same => n,If(1) | ||
same => n,NoOp(inside true nested if) | ||
same => n,ExitIf() | ||
same => n,EndIf() | ||
; Test success: we exited only the inside If, not the outside If | ||
same => n,UserEvent(IfSuccess,Result: Pass) | ||
same => n,Hangup() | ||
same => n,EndIf() | ||
; Test failed: we shouldn't reach the exterior EndIf | ||
same => n,UserEvent(IfSuccess,Result: Fail) | ||
same => n,Assert(0) | ||
same => n,NoOp(after main if) | ||
same => n,Hangup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
testinfo: | ||
summary: 'Ensure that EndIf branches correctly.' | ||
description: | | ||
'This tests the ElseIf application | ||
to ensure branch behavior is correct (issue #341)' | ||
test-modules: | ||
test-object: | ||
config-section: test-object-config | ||
typename: 'test_case.TestCaseModule' | ||
modules: | ||
- | ||
config-section: caller-originator | ||
typename: 'pluggable_modules.Originator' | ||
- | ||
config-section: hangup-monitor | ||
typename: 'pluggable_modules.HangupMonitor' | ||
- | ||
config-section: ami-config | ||
typename: 'pluggable_modules.EventActionModule' | ||
|
||
test-object-config: | ||
connect-ami: True | ||
|
||
caller-originator: | ||
channel: 'Local/s@default' | ||
context: 'nothing' | ||
exten: '0' | ||
priority: '1' | ||
trigger: 'ami_connect' | ||
|
||
hangup-monitor: | ||
ids: '0' | ||
|
||
ami-config: | ||
- | ||
ami-events: | ||
conditions: | ||
match: | ||
Event: 'UserEvent' | ||
UserEvent: 'IfSuccess' | ||
requirements: | ||
match: | ||
Result: 'Pass' | ||
count: 2 | ||
stop_test: | ||
|
||
properties: | ||
tags: | ||
- dial | ||
- apps | ||
dependencies: | ||
- python: 'twisted' | ||
- python: 'starpy' | ||
- asterisk: 'app_dial' | ||
- asterisk: 'app_userevent' | ||
- asterisk: 'app_originate' | ||
- asterisk: 'app_if' | ||
- asterisk: 'pbx_config' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
tests: | ||
- test: 'if_comprehensive' | ||
- test: 'if_endif' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,6 @@ tests: | |
- test: 'mf' | ||
- test: 'sf' | ||
- test: 'read' | ||
- test: 'if' | ||
- dir: 'if' | ||
- test: 'signal' | ||
- test: 'senddtmf' |