aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/utils/test_functest_utils.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-06-18 09:10:19 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-06-19 01:08:39 +0200
commit997969d3d79bcebf13aeae8763b2c9747df03702 (patch)
treecbfd658aeac02c58f10049356bd9350a46cb2700 /functest/tests/unit/utils/test_functest_utils.py
parent644d4c54bab9939da3ef2b1655092c7e4981f57d (diff)
Remove module references __file__
It allows functest to be run directly from a zip file [1]. [1] https://setuptools.readthedocs.io/en/latest/setuptools.html#setting-the-zip-safe-flag Change-Id: I596a71e8cf2bed6dd79655bd5beeb047876a188c Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests/unit/utils/test_functest_utils.py')
-rw-r--r--functest/tests/unit/utils/test_functest_utils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py
index d84a3201..6f7976e4 100644
--- a/functest/tests/unit/utils/test_functest_utils.py
+++ b/functest/tests/unit/utils/test_functest_utils.py
@@ -8,6 +8,7 @@
# http://www.apache.org/licenses/LICENSE-2.0
import logging
+import pkg_resources
import os
import time
import unittest
@@ -56,8 +57,8 @@ class FunctestUtilsTesting(unittest.TestCase):
self.testcase_dict = {'case_name': 'testname',
'criteria': self.criteria}
self.parameter = 'general.openstack.image_name'
- self.config_yaml = os.path.normpath(os.path.join(os.path.dirname(
- os.path.abspath(__file__)), '../../../ci/config_functest.yaml'))
+ self.config_yaml = pkg_resources.resource_filename(
+ 'functest', 'ci/config_functest.yaml')
self.db_url_env = 'http://foo/testdb'
self.testcases_yaml = "test_testcases_yaml"
self.file_yaml = {'general': {'openstack': {'image_name':