Skip to content

Commit

Permalink
chanhes to the tests
Browse files Browse the repository at this point in the history
Signed-off-by: aadityasinha-dotcom <[email protected]>
  • Loading branch information
aadityasinha-dotcom committed Oct 25, 2023
1 parent 81b422e commit 66ceb94
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
15 changes: 9 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"editor.formatOnSave": true,
"python.formatting.provider": "black",
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
"editor.formatOnSave": true,
"python.formatting.provider": "black",
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"python.testing.pytestArgs": ["tests"],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
1 change: 0 additions & 1 deletion src/core/zowe/core_for_zowe_sdk/config_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ def validate_schema(self) -> None:

# validate the $schema property
if path_schema_json:
print(self.jsonc, path_schema_json)
validate_config_json(self.jsonc, path_schema_json, cwd = self.location)

def schema_list(
Expand Down
15 changes: 8 additions & 7 deletions tests/unit/test_zowe_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,13 +609,11 @@ def test_profile_loading_with_invalid_schema(self, get_pass_func):
"""
# Setup - copy profile to fake filesystem created by pyfakefs
with self.assertRaises(ValidationError):
custom_file_path = os.path.join(self.custom_dir, "invalid.zowe.config.json")
# shutil.copy(self.original_invalid_file_path, custom_file_path)
# shutil.copy(self.original_invalid_schema_file_path, self.custom_dir)
custom_file_path = os.path.join(self.custom_dir, "zowe.config.json")
os.chdir(self.custom_dir)
with open(self.original_file_path, 'r') as f:
original_config = commentjson.load(f)
original_config["$schema"] = "./invalid.zowe.schema.json"
original_config["$schema"] = "fixtures/invalid.zowe.schema.json"
with open(os.path.join(self.custom_dir, "invalid.zowe.config.json"), 'w') as f:
commentjson.dump(original_config, f)

Expand All @@ -639,10 +637,13 @@ def test_profile_loading_with_invalid_schema_internet_URI(self, get_pass_func):
"""
# Setup - copy profile to fake filesystem created by pyfakefs
with self.assertRaises(SchemaError):
custom_file_path = os.path.join(self.custom_dir, "invalidUri.zowe.config.json")
shutil.copy(self.original_invalidUri_file_path, custom_file_path)
shutil.copy(self.original_invalidUri_schema_file_path, self.custom_dir)
custom_file_path = os.path.join(self.custom_dir, "zowe.config.json")
os.chdir(self.custom_dir)
with open(self.original_file_path, 'r') as f:
original_config = commentjson.load(f)
original_config["$schema"] = "fixtures/invalidUri.zowe.schema.json"
with open(os.path.join(self.custom_dir, "invalidUri.zowe.config.json"), 'w') as f:
commentjson.dump(original_config, f)

self.setUpCreds(
custom_file_path,
Expand Down

0 comments on commit 66ceb94

Please sign in to comment.