summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils/tests/heat_utils_tests.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-06-07 14:56:00 -0600
committerspisarski <s.pisarski@cablelabs.com>2017-06-07 14:56:00 -0600
commit95d35a166fc66944fb0fc6091f4b84568aef0e7d (patch)
tree5ad804fe917c7c7a2bcf99ad285159ea0f29d015 /snaps/openstack/utils/tests/heat_utils_tests.py
parentc8212122569c2dbf6290b43a0fbde0171c2ffdc5 (diff)
Removed current working directory logic retrieving test file resources.
Some of the SNAPS tests leverage file resources contained within the project. These resources were being accessed via relative paths which required the test clients to ensure that the CWD was the <repo>/snaps directory. Replaced that logic to leverage the import pkg_resources making the tests much more flexible and robust. JIRA: SNAPS-89 Change-Id: Ic9c429ee53e4dd785641e11e1ed4de5aeeab54d1 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/utils/tests/heat_utils_tests.py')
-rw-r--r--snaps/openstack/utils/tests/heat_utils_tests.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/snaps/openstack/utils/tests/heat_utils_tests.py b/snaps/openstack/utils/tests/heat_utils_tests.py
index 08387d8..3d9fe84 100644
--- a/snaps/openstack/utils/tests/heat_utils_tests.py
+++ b/snaps/openstack/utils/tests/heat_utils_tests.py
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
+import pkg_resources
import uuid
import time
@@ -86,8 +87,8 @@ class HeatUtilsCreateStackTests(OSComponentTestCase):
env_values = {'image_name': self.image_creator.image_settings.name,
'flavor_name': self.flavor_creator.flavor_settings.name}
- self.stack_settings = StackSettings(name=stack_name, template_path='../examples/heat/test_heat_template.yaml',
- env_values=env_values)
+ heat_tmplt_path = pkg_resources.resource_filename('examples.heat', 'test_heat_template.yaml')
+ self.stack_settings = StackSettings(name=stack_name, template_path=heat_tmplt_path, env_values=env_values)
self.stack = None
self.heat_client = heat_utils.heat_client(self.os_creds)