Skip to content

Commit

Permalink
Fixed Jobs.list_jobs() return type
Browse files Browse the repository at this point in the history
Signed-off-by: Myrausman <[email protected]>
  • Loading branch information
Myrausman committed Feb 10, 2024
1 parent 09a10d1 commit f419574
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/zos_jobs/zowe/zos_jobs_for_zowe_sdk/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
Copyright Contributors to the Zowe Project.
"""
import os
import json

from zowe.core_for_zowe_sdk import SdkApi

Expand Down Expand Up @@ -223,7 +224,7 @@ def list_jobs(self, owner=None, prefix="*", max_jobs=1000, user_correlator=None)
params["user-correlator"] = user_correlator
custom_args["params"] = params
response_json = self.request_handler.perform_request("GET", custom_args)
return response_json
return json.dumps({"response": response_json})

def submit_from_mainframe(self, jcl_path):
"""Submit a job from a given dataset.
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/test_zos_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def test_get_job_status_should_return_the_status_of_a_job(self):

def test_list_jobs_should_return_valid_spool_information(self):
"""Executing the list_jobs method should return a list of found jobs in JES spool."""
command_output = self.jobs.list_jobs(owner=self.jobs_fixtures_json["TEST_JCL_OWNER"])

command_output = self.jobs.list_jobs(owner=self.jobs_fixtures_json["TEST_JCL_OWNER"])["response"]
self.assertIsInstance(command_output, list)

def test_change_job_class(self):
Expand Down

0 comments on commit f419574

Please sign in to comment.