Commit 0e77ac48 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Add a second call unit test in Python.

parent d2acdcdc
......@@ -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()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment