Commit 081f1104 authored by Ghislain MARY's avatar Ghislain MARY

Fix Python registration unit test.

parent 053fd469
......@@ -12,11 +12,11 @@ class RegisterCoreManager(CoreManager):
info = linphone.AuthInfo.new(test_username, None, test_password, None, realm, domain) # Create authentication structure from identity
lc.add_auth_info(info) # Add authentication info to LinphoneCore
def __init__(self, with_auth = False):
def __init__(self, with_auth = False, logger = None):
vtable = {}
if with_auth:
vtable['auth_info_requested'] = RegisterCoreManager.auth_info_requested
CoreManager.__init__(self, vtable=vtable)
CoreManager.__init__(self, vtable=vtable, logger=logger)
def register_with_refresh(self, refresh, domain, route, late_auth_info = False, expected_final_state = linphone.RegistrationState.RegistrationOk):
assert self.lc is not None
......@@ -70,7 +70,8 @@ class RegisterCoreManager(CoreManager):
assert_equals(self.stats.number_of_LinphoneRegistrationCleared, 0)
self.stop()
assert_equals(self.stats.number_of_LinphoneRegistrationCleared, 1)
# Not testable as the callbacks can not be called once the core destruction has started
#assert_equals(self.stats.number_of_LinphoneRegistrationCleared, 1)
class TestRegister:
......@@ -81,6 +82,6 @@ class TestRegister:
cls.logger = Logger(base + '.log')
def test_simple_register(self):
cm = RegisterCoreManager()
cm = RegisterCoreManager(logger=TestRegister.logger)
cm.register_with_refresh(False, None, None)
assert_equals(cm.stats.number_of_auth_info_requested, 0)
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