[Asterisk-code-review] tests/channels/pjsip/subscriptions/mwi: Fix incorrect value ... (testsuite[master])

Joshua Colp asteriskteam at digium.com
Thu May 26 19:27:20 CDT 2016


Joshua Colp has uploaded a new change for review.

  https://gerrit.asterisk.org/2914

Change subject: tests/channels/pjsip/subscriptions/mwi: Fix incorrect value checking.
......................................................................

tests/channels/pjsip/subscriptions/mwi: Fix incorrect value checking.

If an initial NOTIFY is received for either the mwi_aggregate
or unsolicited/mailbox_count_changes tests they will incorrectly
move on to the next MWI change but the result position will remain
as the first result. This causes each subsequent NOTIFY to be
treated as incorrect.

This change makes it so that the next MWI change only happens
if the NOTIFY in question is not the initial one.

Change-Id: Iac05ae2944ab43cc0e74025aee2c1018c31e0ba0
---
M tests/channels/pjsip/subscriptions/mwi/mwi_aggregate/mwi_check.py
M tests/channels/pjsip/subscriptions/mwi/unsolicited/mailbox_count_changes/mwi_check.py
2 files changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/14/2914/1

diff --git a/tests/channels/pjsip/subscriptions/mwi/mwi_aggregate/mwi_check.py b/tests/channels/pjsip/subscriptions/mwi/mwi_aggregate/mwi_check.py
index c2b7cb8..62f8552 100644
--- a/tests/channels/pjsip/subscriptions/mwi/mwi_aggregate/mwi_check.py
+++ b/tests/channels/pjsip/subscriptions/mwi/mwi_aggregate/mwi_check.py
@@ -76,7 +76,8 @@
 
     def on_mwi_info(self, body):
         self.check_mwi(body)
-        self.controller.next_mwi(self)
+        if self.result_pos != 0:
+            self.controller.next_mwi(self)
 
 
 class MWICallback(object):
diff --git a/tests/channels/pjsip/subscriptions/mwi/unsolicited/mailbox_count_changes/mwi_check.py b/tests/channels/pjsip/subscriptions/mwi/unsolicited/mailbox_count_changes/mwi_check.py
index 54699ff..04bd395 100644
--- a/tests/channels/pjsip/subscriptions/mwi/unsolicited/mailbox_count_changes/mwi_check.py
+++ b/tests/channels/pjsip/subscriptions/mwi/unsolicited/mailbox_count_changes/mwi_check.py
@@ -71,6 +71,8 @@
 
     def on_mwi_info(self, body):
         self.check_mwi(body)
+        if self.result_pos == 0:
+            return
         self.pos += 1
         if (self.pos < len(self.mwis)):
             self.send_mwi()

-- 
To view, visit https://gerrit.asterisk.org/2914
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac05ae2944ab43cc0e74025aee2c1018c31e0ba0
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list