[asterisk-commits] tests/channels/pjsip/subscriptions/mwi: Fix incorrect value ... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 31 11:30:16 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

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(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



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: merged
Gerrit-Change-Id: Iac05ae2944ab43cc0e74025aee2c1018c31e0ba0
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-commits mailing list