diff --git a/mistralclient/tests/unit/v2/test_actions.py b/mistralclient/tests/unit/v2/test_actions.py index dcf20b18..d822c345 100644 --- a/mistralclient/tests/unit/v2/test_actions.py +++ b/mistralclient/tests/unit/v2/test_actions.py @@ -14,7 +14,6 @@ # limitations under the License. import os.path -import pkg_resources as pkg from urllib import parse from urllib import request @@ -96,10 +95,8 @@ class TestActionsV2(base.BaseClientV2Test): status_code=201) # The contents of action_v2.yaml must be identical to ACTION_DEF - path = pkg.resource_filename( - 'mistralclient', - 'tests/unit/resources/action_v2.yaml' - ) + path = os.path.join(os.path.dirname(os.path.abspath(__file__)), + '..', 'resources', 'action_v2.yaml') actions = self.actions.create(path) @@ -160,10 +157,8 @@ class TestActionsV2(base.BaseClientV2Test): json={'actions': [ACTION]}) # The contents of action_v2.yaml must be identical to ACTION_DEF - path = pkg.resource_filename( - 'mistralclient', - 'tests/unit/resources/action_v2.yaml' - ) + path = os.path.join(os.path.dirname(os.path.abspath(__file__)), + '..', 'resources', 'action_v2.yaml') path = os.path.abspath(path) # Convert the file path to file URI @@ -286,10 +281,8 @@ class TestActionsV2(base.BaseClientV2Test): json={'valid': True}) # The contents of action_v2.yaml must be identical to ACTION_DEF - path = pkg.resource_filename( - 'mistralclient', - 'tests/unit/resources/action_v2.yaml' - ) + path = os.path.join(os.path.dirname(os.path.abspath(__file__)), + '..', 'resources', 'action_v2.yaml') result = self.actions.validate(path) diff --git a/mistralclient/tests/unit/v2/test_cli_executions.py b/mistralclient/tests/unit/v2/test_cli_executions.py index 7305ccdb..2affe043 100644 --- a/mistralclient/tests/unit/v2/test_cli_executions.py +++ b/mistralclient/tests/unit/v2/test_cli_executions.py @@ -16,7 +16,7 @@ # under the License. # -import pkg_resources as pkg +import os.path from unittest import mock from oslo_serialization import jsonutils @@ -116,10 +116,8 @@ class TestCLIExecutionsV2(base.BaseCommandTest): def test_create_wf_input_file(self): self.client.executions.create.return_value = EXEC - path = pkg.resource_filename( - 'mistralclient', - 'tests/unit/resources/ctx.json' - ) + path = os.path.join(os.path.dirname(os.path.abspath(__file__)), + '..', 'resources', 'ctx.json') result = self.call( execution_cmd.Create, diff --git a/mistralclient/tests/unit/v2/test_workbooks.py b/mistralclient/tests/unit/v2/test_workbooks.py index 4cbb5b6d..f1425779 100644 --- a/mistralclient/tests/unit/v2/test_workbooks.py +++ b/mistralclient/tests/unit/v2/test_workbooks.py @@ -14,7 +14,6 @@ # limitations under the License. import os.path -import pkg_resources as pkg from urllib import parse from urllib import request @@ -95,11 +94,8 @@ class TestWorkbooksV2(base.BaseClientV2Test): ) # The contents of wb_v2.yaml must be identical to WB_DEF - path = pkg.resource_filename( - 'mistralclient', - 'tests/unit/resources/wb_v2.yaml' - ) - path = os.path.abspath(path) + path = os.path.join(os.path.dirname(os.path.abspath(__file__)), + '..', 'resources', 'wb_v2.yaml') # Convert the file path to file URI uri = parse.urljoin('file:', request.pathname2url(path)) @@ -131,10 +127,8 @@ class TestWorkbooksV2(base.BaseClientV2Test): self.requests_mock.put(self.TEST_URL + URL_TEMPLATE, json=WORKBOOK) # The contents of wb_v2.yaml must be identical to WB_DEF - path = pkg.resource_filename( - 'mistralclient', - 'tests/unit/resources/wb_v2.yaml' - ) + path = os.path.join(os.path.dirname(os.path.abspath(__file__)), + '..', 'resources', 'wb_v2.yaml') wb = self.workbooks.update(path) @@ -207,10 +201,8 @@ class TestWorkbooksV2(base.BaseClientV2Test): ) # The contents of wb_v2.yaml must be identical to WB_DEF - path = pkg.resource_filename( - 'mistralclient', - 'tests/unit/resources/wb_v2.yaml' - ) + path = os.path.join(os.path.dirname(os.path.abspath(__file__)), + '..', 'resources', 'wb_v2.yaml') result = self.workbooks.validate(path) diff --git a/mistralclient/tests/unit/v2/test_workflows.py b/mistralclient/tests/unit/v2/test_workflows.py index 4b28fdcb..38bf0600 100644 --- a/mistralclient/tests/unit/v2/test_workflows.py +++ b/mistralclient/tests/unit/v2/test_workflows.py @@ -13,7 +13,6 @@ # limitations under the License. import os.path -import pkg_resources as pkg from urllib import parse from urllib import request @@ -71,10 +70,8 @@ class TestWorkflowsV2(base.BaseClientV2Test): ) # The contents of wf_v2.yaml must be identical to WF_DEF - path = pkg.resource_filename( - 'mistralclient', - 'tests/unit/resources/wf_v2.yaml' - ) + path = os.path.join(os.path.dirname(os.path.abspath(__file__)), + '..', 'resources', 'wf_v2.yaml') wfs = self.workflows.create(path) @@ -126,10 +123,9 @@ class TestWorkflowsV2(base.BaseClientV2Test): ) # The contents of wf_v2.yaml must be identical to WF_DEF - path = pkg.resource_filename( - 'mistralclient', - 'tests/unit/resources/wf_v2.yaml' - ) + path = os.path.join(os.path.dirname(os.path.abspath(__file__)), + '..', 'resources', 'wf_v2.yaml') + path = os.path.abspath(path) # Convert the file path to file URI