mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-29 00:59:20 +00:00
Add a second call unit test in Python.
This commit is contained in:
parent
d2acdcdc1b
commit
0e77ac4883
2 changed files with 24 additions and 3 deletions
|
|
@ -175,6 +175,10 @@ class CoreManager:
|
|||
res = func(*managers)
|
||||
return res
|
||||
|
||||
@classmethod
|
||||
def wait_for(cls, manager1, manager2, func):
|
||||
return cls.wait_for_until(manager1, manager2, func, 10000)
|
||||
|
||||
@classmethod
|
||||
def registration_state_changed(cls, lc, cfg, state, message):
|
||||
manager = lc.user_data
|
||||
|
|
@ -316,9 +320,6 @@ class CoreManager:
|
|||
def stop(self):
|
||||
self.lc = None
|
||||
|
||||
def __del__(self):
|
||||
self.stop()
|
||||
|
||||
def configure_lc_from(self, vtable, resources_path, rc_path):
|
||||
filepath = None
|
||||
if rc_path is not None:
|
||||
|
|
|
|||
|
|
@ -26,3 +26,23 @@ class TestCall:
|
|||
out_call_log = pauline.lc.call_logs[0]
|
||||
assert out_call_log is not None
|
||||
assert_equals(out_call_log.status, linphone.CallStatus.CallAborted)
|
||||
marie.stop()
|
||||
pauline.stop()
|
||||
|
||||
def test_declined_call(self):
|
||||
marie = linphonetester.CoreManager('marie_rc', logger=TestCall.logger)
|
||||
pauline = linphonetester.CoreManager('pauline_rc', logger=TestCall.logger)
|
||||
out_call = pauline.lc.invite_address(marie.identity)
|
||||
assert_equals(linphonetester.CoreManager.wait_for(pauline, marie, lambda pauline, marie: marie.stats.number_of_LinphoneCallIncomingReceived == 1), True)
|
||||
in_call = marie.lc.current_call
|
||||
assert in_call is not None
|
||||
if in_call is not None:
|
||||
marie.lc.terminate_call(in_call)
|
||||
assert_equals(linphonetester.CoreManager.wait_for(pauline, marie, lambda pauline, marie: marie.stats.number_of_LinphoneCallReleased == 1), True)
|
||||
assert_equals(linphonetester.CoreManager.wait_for(pauline, marie, lambda pauline, marie: pauline.stats.number_of_LinphoneCallReleased == 1), True)
|
||||
assert_equals(marie.stats.number_of_LinphoneCallEnd, 1)
|
||||
assert_equals(pauline.stats.number_of_LinphoneCallEnd, 1)
|
||||
assert_equals(in_call.reason, linphone.Reason.ReasonDeclined)
|
||||
assert_equals(out_call.reason, linphone.Reason.ReasonDeclined)
|
||||
marie.stop()
|
||||
pauline.stop()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue