mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 07:38:09 +00:00
Fix Python registration unit test.
This commit is contained in:
parent
053fd46975
commit
081f1104a8
1 changed files with 5 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue