Commit b05b3db1 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Add first Python module unit tests.

parent 294916d0
from import assert_equals
import linphone
test_username = "liblinphone_tester"
test_route = ""
def create_address(domain):
addr =
assert addr != None
addr.username = test_username
assert_equals(addr.username, test_username)
if domain is not None:
domain = test_route
addr.domain = domain
assert_equals(addr.domain, domain)
addr.display_name = None
addr.display_name = "Mr Tester"
assert_equals(addr.display_name, "Mr Tester")
return addr
class TestSetup:
def test_address(self):
def test_core_init(self):
lc ={}, None, None)
assert lc is not None
if lc is not None:
def test_interpret_url(self):
lc ={}, None, None)
assert lc is not None
sips_address = ""
address = lc.interpret_url(sips_address)
assert address is not None
assert_equals(address.scheme, "sips")
assert_equals(address.username, "margaux")
assert_equals(address.domain, "")
def test_lpconfig_from_buffer(self):
buffer = "[buffer]\ntest=ok"
buffer_linebreaks = "[buffer_linebreaks]\n\n\n\r\n\n\r\ntest=ok"
conf = linphone.LpConfig.new_from_buffer(buffer)
assert_equals(conf.get_string("buffer", "test", ""), "ok")
conf = linphone.LpConfig.new_from_buffer(buffer_linebreaks)
assert_equals(conf.get_string("buffer_linebreaks", "test", ""), "ok")
def test_create_chat_room(self):
lc ={}, None, None)
assert lc is not None
cr = lc.get_chat_room_from_uri("")
assert cr is not None
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