Skip to content

Commit 016670e

Browse files
remove deprecated methods
Signed-off-by: Olamide Ojo <[email protected]>
1 parent 5408903 commit 016670e

File tree

2 files changed

+34
-30
lines changed

2 files changed

+34
-30
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,7 @@ All notable changes to the Zowe Client Python SDK will be documented in this fil
139139
- Fixed profile merge order to match Node.js SDK [#190](https://github.com/zowe/zowe-client-python-sdk/issues/190)
140140
- Fixed issue for datasets and jobs with special characters in URL [#211](https://github.com/zowe/zowe-client-python-sdk/issues/211)
141141
- Fixed exception handling in session.py [#213](https://github.com/zowe/zowe-client-python-sdk/issues/213)
142+
143+
### Bug Fixes
144+
- Updated the sample scripts in readmes to remove/ stop using methods that were deprecated in #276
145+
- Therefore this fixes #336

tests/integration/test_zos_files.py

+30-30
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_list_dsn_should_return_a_list_of_datasets(self):
4747

4848
for scenario in scenarios:
4949
# Get the command output
50-
command_output = self.files.list_dsn(self.files_fixtures["TEST_HLQ"], scenario["attributes"])
50+
command_output = self.files.ds.list(self.files_fixtures["TEST_HLQ"], scenario["attributes"])
5151

5252
# Assert that command_output['items'] is a list
5353
self.assertIsInstance(command_output, DatasetListResponse)
@@ -65,38 +65,38 @@ def test_list_dsn_should_return_a_list_of_datasets(self):
6565
self.assertIn(expected_attr, attributes)
6666

6767
def test_list_members_should_return_a_list_of_members(self):
68-
"""Executing list_dsn_members should return a list of members."""
69-
command_output = self.files.list_dsn_members(self.files_fixtures["TEST_PDS"])
68+
"""Executing list_members should return a list of members."""
69+
command_output = self.files.ds.list_members(self.files_fixtures["TEST_PDS"])
7070
self.assertIsInstance(command_output, MemberListResponse)
7171

72-
def test_get_dsn_content_should_return_content_from_dataset(self):
73-
"""Executing get_dsn_content should return content from dataset."""
74-
command_output = self.files.get_dsn_content(self.test_member_jcl)
72+
def test_get_content_should_return_content_from_dataset(self):
73+
"""Executing gget_content should return content from dataset."""
74+
command_output = self.files.ds.get_content(self.test_member_jcl)
7575
self.assertIsInstance(command_output, str)
7676

77-
def test_get_dsn_content_streamed_should_return_response_content(self):
78-
"""Executing get_dsn_content_streamed should return response object from the server."""
79-
command_output = self.files.get_dsn_content_streamed(self.test_member_jcl)
77+
def test_get_content_should_return_response_content(self):
78+
"""Executing get_content should return response object from the server."""
79+
command_output = self.files.ds.get_content(self.test_member_jcl)
8080
self.assertIsInstance(command_output.raw, urllib3.response.HTTPResponse)
8181

82-
def test_get_dsn_binary_content_streamed_should_return_response_content(self):
83-
"""Executing get_dsn_binary_content_streamed should return response object from the server."""
84-
command_output = self.files.get_dsn_binary_content_streamed(self.test_member_jcl)
82+
def test_get_binary_content_should_return_response_content(self):
83+
"""Executing get_binary_content should return response object from the server."""
84+
command_output = self.files.ds.get_binary_content(self.test_member_jcl)
8585
self.assertIsInstance(command_output.raw, urllib3.response.HTTPResponse)
8686

8787
def test_get_file_content_streamed_should_return_response_content(self):
88-
"""Executing get_dsn_binary_content_streamed should return response object from the server."""
89-
command_output = self.files.get_file_content_streamed(self.files_fixtures["TEST_USS"])
88+
"""Executing get_binary_content should return response object from the server."""
89+
command_output = self.files.uss.get_content_streamed(self.files_fixtures["TEST_USS"])
9090
self.assertIsInstance(command_output.raw, urllib3.response.HTTPResponse)
9191

92-
def test_write_to_dsn_should_be_possible(self):
93-
"""Executing write_to_dsn should be possible."""
94-
command_output = self.files.write_to_dsn(self.test_member_generic, "HELLO WORLD")
92+
def test_write_should_be_possible(self):
93+
"""Executing write should be possible."""
94+
command_output = self.files.ds.write(self.test_member_generic, "HELLO WORLD")
9595
self.assertTrue(command_output == None)
9696

9797
def test_copy_uss_to_data_set_should_be_possible(self):
9898
"""Executing copy_uss_to_data_set should be possible."""
99-
command_output = self.files.copy_uss_to_data_set(
99+
command_output = self.files.ds.copy_uss_to_data_set(
100100
self.files_fixtures["TEST_USS"], self.files_fixtures["TEST_PDS"] + "(TEST2)", replace=True
101101
)
102102
self.assertTrue(command_output == None)
@@ -110,7 +110,7 @@ def test_copy_data_set_or_member_should_be_possible(self):
110110
"to_member_name": "TEST",
111111
"replace": True,
112112
}
113-
command_output = self.files.copy_data_set_or_member(**test_case)
113+
command_output = self.files.ds.copy_data_set_or_member(**test_case)
114114
self.assertTrue(command_output == None)
115115

116116
def test_mount_unmount_zfs_file_system(self):
@@ -119,47 +119,47 @@ def test_mount_unmount_zfs_file_system(self):
119119
mount_point = self.files_fixtures["TEST_USS_MOUNT"]
120120

121121
# Create a zfs file system
122-
zfs_file_system = self.files.create_zfs_file_system(self.test2_zfs_file_system, self.create_zfs_options)
122+
zfs_file_system = self.files.fs.create(self.test2_zfs_file_system, self.create_zfs_options)
123123

124124
# Mount file system
125-
command_output = self.files.mount_file_system(
125+
command_output = self.files.fs.mount(
126126
self.test2_zfs_file_system, mount_point, self.mount_zfs_file_system_options
127127
)
128128
self.assertTrue(command_output == None)
129129

130130
# List a zfs file system
131-
command_output = self.files.list_unix_file_systems(file_system_name=self.test2_zfs_file_system.upper())
131+
command_output = self.files.fs.list(file_system_name=self.test2_zfs_file_system.upper())
132132
self.assertTrue(len(command_output["items"]) > 0)
133133

134134
# Unmount file system
135-
command_output = self.files.unmount_file_system(self.test2_zfs_file_system)
135+
command_output = self.files.fs.unmount(self.test2_zfs_file_system)
136136
self.assertTrue(command_output == None)
137137

138138
# Delete file system
139-
command_output = self.files.delete_zfs_file_system(self.test2_zfs_file_system)
139+
command_output = self.files.fs.delete(self.test2_zfs_file_system)
140140
self.assertTrue(command_output == None)
141141

142142
def test_upload_download_delete_dataset(self):
143-
self.files.upload_file_to_dsn(SAMPLE_JCL_FIXTURE_PATH, self.test_ds_upload)
144-
self.files.download_dsn(self.test_ds_upload, SAMPLE_JCL_FIXTURE_PATH + ".tmp")
143+
self.files.ds.upload_file(SAMPLE_JCL_FIXTURE_PATH, self.test_ds_upload)
144+
self.files.ds.download(self.test_ds_upload, SAMPLE_JCL_FIXTURE_PATH + ".tmp")
145145

146146
with open(SAMPLE_JCL_FIXTURE_PATH, "r") as in_file:
147147
old_file_content = in_file.read()
148148
with open(SAMPLE_JCL_FIXTURE_PATH + ".tmp", "r") as in_file:
149149
new_file_content = in_file.read().rstrip()
150150
self.assertEqual(old_file_content, new_file_content)
151151

152-
self.files.delete_data_set(self.files_fixtures["TEST_PDS"], member_name=self.files_fixtures["TEST_MEMBER_NEW"])
152+
self.Dataset.delete(self.files_fixtures["TEST_PDS"], member_name=self.files_fixtures["TEST_MEMBER_NEW"])
153153
os.unlink(SAMPLE_JCL_FIXTURE_PATH + ".tmp")
154154

155155
def test_upload_download_delete_uss(self):
156-
self.files.upload_file_to_uss(SAMPLE_JCL_FIXTURE_PATH, self.test_uss_upload)
157-
self.files.download_uss(self.test_uss_upload, SAMPLE_JCL_FIXTURE_PATH + ".tmp")
156+
self.USSFiles.upload(SAMPLE_JCL_FIXTURE_PATH, self.test_uss_upload)
157+
self.files.uss.download(self.test_uss_upload, SAMPLE_JCL_FIXTURE_PATH + ".tmp")
158158
with open(SAMPLE_JCL_FIXTURE_PATH, "r") as in_file:
159159
old_file_content = in_file.read()
160160
with open(SAMPLE_JCL_FIXTURE_PATH + ".tmp", "r") as in_file:
161161
new_file_content = in_file.read()
162162
self.assertEqual(old_file_content, new_file_content)
163163

164-
self.files.delete_uss(self.test_uss_upload)
164+
self.files.uss.delete(self.test_uss_upload)
165165
os.unlink(SAMPLE_JCL_FIXTURE_PATH + ".tmp")

0 commit comments

Comments
 (0)