mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Revert "Handle accounts manager to the Python module unit tests."
This reverts commit b61302f9b1.
This commit is contained in:
parent
b61302f9b1
commit
180de834ee
9 changed files with 5 additions and 85 deletions
|
|
@ -201,22 +201,16 @@ LinphoneAddress *account_manager_check_account(AccountManager *m, LinphoneProxyC
|
|||
return account->modified_identity;
|
||||
}
|
||||
|
||||
LinphoneAddress * account_manager_check_accounts(LinphoneCore *lc, LinphoneAddress *identity){
|
||||
void linphone_core_manager_check_accounts(LinphoneCoreManager *m){
|
||||
const MSList *it;
|
||||
AccountManager *am=account_manager_get();
|
||||
|
||||
for(it=linphone_core_get_proxy_config_list(lc);it!=NULL;it=it->next){
|
||||
for(it=linphone_core_get_proxy_config_list(m->lc);it!=NULL;it=it->next){
|
||||
LinphoneProxyConfig *cfg=(LinphoneProxyConfig *)it->data;
|
||||
LinphoneAddress *modified_identity=account_manager_check_account(am,cfg);
|
||||
if (identity){
|
||||
linphone_address_unref(identity);
|
||||
if (m->identity){
|
||||
linphone_address_unref(m->identity);
|
||||
}
|
||||
identity=linphone_address_ref(modified_identity);
|
||||
m->identity=linphone_address_ref(modified_identity);
|
||||
}
|
||||
|
||||
return identity;
|
||||
}
|
||||
|
||||
void linphone_core_manager_check_accounts(LinphoneCoreManager *m){
|
||||
m->identity=account_manager_check_accounts(m->lc,m->identity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -279,7 +279,6 @@ void liblinphone_tester_check_rtcp(LinphoneCoreManager* caller, LinphoneCoreMana
|
|||
void liblinphone_tester_clock_start(MSTimeSpec *start);
|
||||
bool_t liblinphone_tester_clock_elapsed(const MSTimeSpec *start, int value_ms);
|
||||
void linphone_core_manager_check_accounts(LinphoneCoreManager *m);
|
||||
LinphoneAddress * account_manager_check_accounts(LinphoneCore *lc, LinphoneAddress *identity);
|
||||
void account_manager_destroy(void);
|
||||
LinphoneCore* configure_lc_from(LinphoneCoreVTable* v_table, const char* path, const char* file, void* user_data);
|
||||
#ifdef ANDROID
|
||||
|
|
|
|||
|
|
@ -1,54 +1,4 @@
|
|||
#include "private.h"
|
||||
#include "liblinphone_tester.h"
|
||||
|
||||
static PyObject * pylinphone_testing_module_method_check_accounts(PyObject *self, PyObject *args) {
|
||||
PyObject *_core;
|
||||
PyObject *_identity;
|
||||
PyObject * pyresult;
|
||||
PyObject * pyret;
|
||||
LinphoneCore *_core_native_ptr;
|
||||
LinphoneAddress *_identity_native_ptr;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "OO", &_core, &_identity)) {
|
||||
return NULL;
|
||||
}
|
||||
if ((_core != Py_None) && !PyObject_IsInstance(_core, (PyObject *)&pylinphone_CoreType)) {
|
||||
PyErr_SetString(PyExc_TypeError, "The '_core' argument must be a linphone.Core instance.");
|
||||
return NULL;
|
||||
}
|
||||
if ((_core != Py_None) && !PyObject_IsInstance(_identity, (PyObject *)&pylinphone_AddressType)) {
|
||||
PyErr_SetString(PyExc_TypeError, "The '_identity' argument must be a linphone.Address instance.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((_core != NULL) && (_core != Py_None)) {
|
||||
if ((_core_native_ptr = pylinphone_Core_get_native_ptr(_core)) == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if ((_identity != NULL) && (_identity != Py_None)) {
|
||||
if ((_identity_native_ptr = pylinphone_Address_get_native_ptr(_core)) == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
pylinphone_trace(1, "[PYLINPHONE] >>> %s(%p [%p], %p [%p])", __FUNCTION__, _core, _core_native_ptr, _identity, _identity_native_ptr);
|
||||
_identity_native_ptr = account_manager_check_accounts(_core_native_ptr, _identity_native_ptr);
|
||||
pylinphone_dispatch_messages();
|
||||
pyresult = pylinphone_Address_from_native_ptr(&pylinphone_AddressType, _identity_native_ptr);
|
||||
pyret = Py_BuildValue("O", pyresult);
|
||||
|
||||
pylinphone_trace(-1, "[PYLINPHONE] <<< %s -> %p", __FUNCTION__, pyret);
|
||||
return pyret;
|
||||
}
|
||||
|
||||
static PyObject * pylinphone_testing_module_method_clean_accounts(PyObject *self, PyObject *args) {
|
||||
pylinphone_trace(1, "[PYLINPHONE] >>> %s()", __FUNCTION__);
|
||||
account_manager_destroy();
|
||||
pylinphone_dispatch_messages();
|
||||
pylinphone_trace(-1, "[PYLINPHONE] <<< %s -> None", __FUNCTION__);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject * pylinphone_testing_module_method_set_dns_user_hosts_file(PyObject *self, PyObject *args) {
|
||||
PyObject *_core;
|
||||
|
|
@ -78,8 +28,6 @@ static PyObject * pylinphone_testing_module_method_set_dns_user_hosts_file(PyObj
|
|||
}
|
||||
|
||||
static PyMethodDef pylinphone_TestingModuleMethods[] = {
|
||||
{ "check_accounts", pylinphone_testing_module_method_check_accounts, METH_VARARGS, "Checks that testing SIP accounts are created or creates them." },
|
||||
{ "clean_accounts", pylinphone_testing_module_method_clean_accounts, METH_VARARGS, "Cleans the testing SIP accounts." },
|
||||
{ "set_dns_user_hosts_file", pylinphone_testing_module_method_set_dns_user_hosts_file, METH_VARARGS, "Allows to set a user specified hosts file." },
|
||||
/* Sentinel */
|
||||
{ NULL, NULL, 0, NULL }
|
||||
|
|
|
|||
|
|
@ -493,7 +493,6 @@ class CoreManager:
|
|||
assert_equals(os.path.isfile(filepath), True)
|
||||
lc = linphone.Core.new(vtable, None, filepath)
|
||||
linphone.testing.set_dns_user_hosts_file(lc, os.path.join(resources_path, 'tester_hosts'))
|
||||
self.identity = linphone.testing.check_accounts(lc, self.identity)
|
||||
lc.root_ca = os.path.join(resources_path, 'certificates', 'cn', 'cafile.pem')
|
||||
lc.ring = os.path.join(resources_path, 'sounds', 'oldphone.wav')
|
||||
lc.ringback = os.path.join(resources_path, 'sounds', 'ringback.wav')
|
||||
|
|
|
|||
|
|
@ -12,10 +12,6 @@ class TestCall:
|
|||
base, ext = os.path.splitext(os.path.basename(__file__))
|
||||
cls.logger = Logger(base + '.log')
|
||||
|
||||
@classmethod
|
||||
def teardown_class(cls):
|
||||
linphone.testing.clean_accounts()
|
||||
|
||||
def test_early_declined_call(self):
|
||||
marie = CoreManager('marie_rc', logger=TestCall.logger)
|
||||
pauline = CoreManager('pauline_rc', logger=TestCall.logger)
|
||||
|
|
|
|||
|
|
@ -13,10 +13,6 @@ class TestMessage:
|
|||
base, ext = os.path.splitext(os.path.basename(__file__))
|
||||
cls.logger = Logger(base + '.log')
|
||||
|
||||
@classmethod
|
||||
def teardown_class(cls):
|
||||
linphone.testing.clean_accounts()
|
||||
|
||||
def wait_for_server_to_purge_messages(self, manager1, manager2):
|
||||
# Wait a little bit just to have time to purge message stored in the server
|
||||
CoreManager.wait_for_until(manager1, manager2, lambda manager1, manager2: False, 100)
|
||||
|
|
|
|||
|
|
@ -21,10 +21,6 @@ class TestPresence:
|
|||
base, ext = os.path.splitext(os.path.basename(__file__))
|
||||
cls.logger = Logger(base + '.log')
|
||||
|
||||
@classmethod
|
||||
def teardown_class(cls):
|
||||
linphone.testing.clean_accounts()
|
||||
|
||||
def subscribe_to_callee_presence(self, caller_mgr, callee_mgr):
|
||||
initial_caller_stats = deepcopy(caller_mgr.stats)
|
||||
initial_callee_stats = deepcopy(callee_mgr.stats)
|
||||
|
|
|
|||
|
|
@ -81,10 +81,6 @@ class TestRegister:
|
|||
base, ext = os.path.splitext(os.path.basename(__file__))
|
||||
cls.logger = Logger(base + '.log')
|
||||
|
||||
@classmethod
|
||||
def teardown_class(cls):
|
||||
linphone.testing.clean_accounts()
|
||||
|
||||
def test_simple_register(self):
|
||||
cm = RegisterCoreManager(logger=TestRegister.logger)
|
||||
cm.register_with_refresh(False, None, None)
|
||||
|
|
|
|||
|
|
@ -10,10 +10,6 @@ class TestSetup:
|
|||
base, ext = os.path.splitext(os.path.basename(__file__))
|
||||
cls.logger = Logger(base + '.log')
|
||||
|
||||
@classmethod
|
||||
def teardown_class(cls):
|
||||
linphone.testing.clean_accounts()
|
||||
|
||||
def test_address(self):
|
||||
create_address(None)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue