From b824ac0e518b57c30610db6a71078e2c6c8ded59 Mon Sep 17 00:00:00 2001 From: zFernand0 <37381190+zFernand0@users.noreply.github.com> Date: Wed, 27 Sep 2023 21:02:35 +0000 Subject: [PATCH] try to load jsonschema Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com> --- tests/unit/test_zowe_core.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/unit/test_zowe_core.py b/tests/unit/test_zowe_core.py index 9f49de79..bf71ef6f 100644 --- a/tests/unit/test_zowe_core.py +++ b/tests/unit/test_zowe_core.py @@ -2,18 +2,20 @@ # Including necessary paths import base64 +import commentjson +import importlib.util import json +import keyring import os import shutil -import keyring -import sys import unittest + +from jsonschema import validate, ValidationError, SchemaError +from pyfakefs.fake_filesystem_unittest import TestCase from unittest import mock from unittest.mock import patch -from jsonschema import validate, ValidationError, SchemaError + from zowe.core_for_zowe_sdk.validators import validate_config_json -import commentjson -from pyfakefs.fake_filesystem_unittest import TestCase from zowe.core_for_zowe_sdk import ( ApiConnection, ConfigFile, @@ -207,7 +209,11 @@ def setUp(self): self.original_invalidUri_schema_file_path = os.path.join( FIXTURES_PATH, "invalidUri.zowe.schema.json" ) - # self.fs.add_real_directory(os.path.join(FIXTURES_PATH, "../../../env/lib")) + + loader = importlib.util.find_spec('jsonschema') + module_path = loader.origin + self.fs.add_real_directory(os.path.dirname(module_path)) + self.fs.add_real_file(self.original_file_path) self.fs.add_real_file(self.original_user_file_path) self.fs.add_real_file(self.original_nested_file_path)