From 0f644703bf2f4896ac073ff79930021a39299928 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 11 Sep 2014 15:27:21 +0200 Subject: [PATCH] Allow running Python unit tests from an installed package. --- tools/python/unittests/linphonetester.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/python/unittests/linphonetester.py b/tools/python/unittests/linphonetester.py index 15d0f1327..10c5ab36b 100644 --- a/tools/python/unittests/linphonetester.py +++ b/tools/python/unittests/linphonetester.py @@ -10,7 +10,12 @@ import time test_username = "liblinphone_tester" test_password = "secret" test_route = "sip2.linphone.org" -tester_resources_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../tester/")) +if os.path.isdir(os.path.join(os.path.dirname(__file__), "rcfiles")): + # Running unit tests from an installed package + tester_resources_path = os.path.abspath(os.path.dirname(__file__)) +else: + # Running unit tests from the linphone sources + tester_resources_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../tester/")) def create_address(domain):