From 9483198077cbd0b7d4bdee5fa37d9d7db9c2cbcc Mon Sep 17 00:00:00 2001 From: Dennis Philippzig Date: Wed, 6 Dec 2023 08:57:10 +0100 Subject: [PATCH 1/3] added recfm "FBA", "FBM", "VBA", "VBM" to create_data_set Signed-off-by: Dennis Philippzig Signed-off-by: Dennis Philippzig <92379179+dlcblade@users.noreply.github.com> --- .../zowe/zos_files_for_zowe_sdk/files.py | 2 +- tests/unit/test_zos_files.py | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/zos_files/zowe/zos_files_for_zowe_sdk/files.py b/src/zos_files/zowe/zos_files_for_zowe_sdk/files.py index f338854a..fa817fdb 100644 --- a/src/zos_files/zowe/zos_files_for_zowe_sdk/files.py +++ b/src/zos_files/zowe/zos_files_for_zowe_sdk/files.py @@ -331,7 +331,7 @@ def create_data_set(self, dataset_name, options={}): if options.get(opt) is None: options[opt] = "F" else: - if options[opt] not in ("F", "FB", "V", "VB", "U"): + if options[opt] not in ("F", "FB", "V", "VB", "U", "FBA", "FBM", "VBA", "VBM"): raise KeyError if opt == "blksize": diff --git a/tests/unit/test_zos_files.py b/tests/unit/test_zos_files.py index 927e80d5..acd3478f 100644 --- a/tests/unit/test_zos_files.py +++ b/tests/unit/test_zos_files.py @@ -356,6 +356,39 @@ def test_rename_dataset_member_parametrized(self): with self.assertRaises(ValueError) as e_info: files_test_profile.rename_dataset_member(*test_case[0]) self.assertEqual(str(e_info.exception), "Invalid value for enq.") + + @mock.patch("requests.Session.send") + def test_create_data_set_accept_valid_recfm(self, mock_send_request): + """Test if create dataset does accept all accepted record formats""" + mock_send_request.return_value = mock.Mock(headers={"Content-Type": "application/json"}, status_code=201) + for recfm in ["F", "FB", "V", "VB", "U", "FBA", "FBM", "VBA", "VBM"]: + Files(self.test_profile).create_data_set( + "DSNAME123", options={ + "alcunit": "CYL", + "dsorg": "PO", + "primary": 1, + "dirblk": 5, + "recfm": recfm, + "blksize": 6160, + "lrecl": 80 + } + ) + mock_send_request.assert_called() + + def test_create_data_set_does_not_accept_invalid_recfm(self): + """Test if create dataset raises an error for invalid record formats""" + with self.assertRaises(KeyError): + Files(self.test_profile).create_data_set( + "DSNAME123", options={ + "alcunit": "CYL", + "dsorg": "PO", + "primary": 1, + "dirblk": 5, + "recfm": "XX", + "blksize": 6160, + "lrecl": 80 + } + ) def test_create_data_set_raises_error_without_required_arguments(self): """Test not providing required arguments raises an error""" From b47b1e8f0bce3dadbc39f3230de10bb1593fb4f5 Mon Sep 17 00:00:00 2001 From: Dennis Philippzig Date: Wed, 6 Dec 2023 08:58:49 +0100 Subject: [PATCH 2/3] added recfm "FBA", "FBM", "VBA", "VBM" to create_data_set Signed-off-by: Dennis Philippzig Signed-off-by: Dennis Philippzig <92379179+dlcblade@users.noreply.github.com> --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index abf4484a..497807df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to the Zowe Client Python SDK will be documented in this fil - Fixed Secrets SDK requiring LD_LIBRARY_PATH to be defined when installed from wheel on Linux [#229](https://github.com/zowe/zowe-client-python-sdk/issues/229) - Fixed 'issue_command' Console API function to provide custom console name [#231](https://github.com/zowe/zowe-client-python-sdk/issues/231) +- Fixed 'create_data_set' to accept "FBA", "FBM", "VBA", "VBM" as valid recfm [#240](https://github.com/zowe/zowe-client-python-sdk/issues/240) ## `1.0.0-dev11` From d7c91025ac04979a1a14c83593735277cc34e722 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Fri, 8 Dec 2023 09:03:17 -0500 Subject: [PATCH 3/3] Update header in CHANGELOG.md Signed-off-by: Timothy Johnson --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 497807df..541392bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,18 @@ All notable changes to the Zowe Client Python SDK will be documented in this file. +## Recent Changes + +### Bug Fixes + +- Fixed 'create_data_set' to accept "FBA", "FBM", "VBA", "VBM" as valid recfm [#240](https://github.com/zowe/zowe-client-python-sdk/issues/240) + ## `1.0.0-dev12` ### Bug Fixes - Fixed Secrets SDK requiring LD_LIBRARY_PATH to be defined when installed from wheel on Linux [#229](https://github.com/zowe/zowe-client-python-sdk/issues/229) - Fixed 'issue_command' Console API function to provide custom console name [#231](https://github.com/zowe/zowe-client-python-sdk/issues/231) -- Fixed 'create_data_set' to accept "FBA", "FBM", "VBA", "VBM" as valid recfm [#240](https://github.com/zowe/zowe-client-python-sdk/issues/240) ## `1.0.0-dev11`