Skip to content

Commit 2326a40

Browse files
committed
Merge branch 'convert_windows_line_ending' into TSO
2 parents 85d84c8 + e491f73 commit 2326a40

17 files changed

+47
-134
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ All notable changes to the Zowe Client Python SDK will be documented in this fil
66

77
### Enhancements
88

9+
- Added logger class to core SDK [#185](https://github.com/zowe/zowe-client-python-sdk/issues/185)
910
- Added logger class to core SDK [#185](https://github.com/zowe/zowe-client-python-sdk/issues/185)
1011
- Added classes for handling `Datasets`, `USSFiles`, and `FileSystems` in favor of the single Files class. [#264](https://github.com/zowe/zowe-client-python-sdk/issues/264)
1112
- Refactored testings into proper folders and files and add more tests [#265](https://github.com/zowe/zowe-client-python-sdk/issues/265)

src/zos_files/zowe/zos_files_for_zowe_sdk/uss.py

-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ def get_content(self, filepath_name):
125125
A JSON with the contents of the specified USS file
126126
"""
127127
custom_args = self._create_custom_request_arguments()
128-
# custom_args["params"] = {"filepath-name": filepath_name}
129128
custom_args["url"] = "{}fs{}".format(self.request_endpoint, filepath_name)
130129
response_json = self.request_handler.perform_request("GET", custom_args)
131130
return response_json

tests/unit/files/constants.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
profile = {
2+
"host": "mock-url.com",
3+
"user": "Username",
4+
"password": "Password",
5+
"port": 443,
6+
"rejectUnauthorized": True,
7+
}

tests/unit/files/datasets/test_copy.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
import re
21
from unittest import TestCase, mock
3-
4-
from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets
2+
from zowe.zos_files_for_zowe_sdk import Files
3+
from unit.files.constants import profile
54

65

76
class TestCreateClass(TestCase):
87
"""File class unit tests."""
98

109
def setUp(self):
1110
"""Setup fixtures for File class."""
12-
self.test_profile = {
13-
"host": "mock-url.com",
14-
"user": "Username",
15-
"password": "Password",
16-
"port": 443,
17-
"rejectUnauthorized": True,
18-
}
11+
self.test_profile = profile
1912

2013
@mock.patch("requests.Session.send")
2114
def test_copy_uss_to_dataset(self, mock_send_request):

tests/unit/files/datasets/test_create.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
import re
21
from unittest import TestCase, mock
3-
4-
from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets
2+
from zowe.zos_files_for_zowe_sdk import Files
3+
from unit.files.constants import profile
54

65

76
class TestCreateClass(TestCase):
87
"""File class unit tests."""
98

109
def setUp(self):
1110
"""Setup fixtures for File class."""
12-
self.test_profile = {
13-
"host": "mock-url.com",
14-
"user": "Username",
15-
"password": "Password",
16-
"port": 443,
17-
"rejectUnauthorized": True,
18-
}
11+
self.test_profile = profile
1912

2013
@mock.patch("requests.Session.send")
2114
def test_create_data_set_accept_valid_recfm(self, mock_send_request):

tests/unit/files/datasets/test_delete.py

+4-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
import re
21
from unittest import TestCase, mock
3-
4-
from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets
2+
from zowe.zos_files_for_zowe_sdk import Files
3+
from unit.files.constants import profile
54

65

76
class TestDeleteClass(TestCase):
87
"""File class unit tests."""
98

109
def setUp(self):
1110
"""Setup fixtures for File class."""
12-
self.test_profile = {
13-
"host": "mock-url.com",
14-
"user": "Username",
15-
"password": "Password",
16-
"port": 443,
17-
"rejectUnauthorized": True,
18-
}
11+
self.test_profile = profile
1912

2013
@mock.patch("requests.Session.send")
2114
def test_delete(self, mock_send_request):
@@ -26,7 +19,7 @@ def test_delete(self, mock_send_request):
2619
mock_send_request.assert_called_once()
2720

2821
@mock.patch("requests.Session.send")
29-
def test_delete_pram(self, mock_send_request):
22+
def test_delete_param(self, mock_send_request):
3023
"""Test list members sends request"""
3124
self.files_instance = Files(self.test_profile)
3225
mock_send_request.return_value = mock.Mock(headers={"Content-Type": "application/json"}, status_code=200)

tests/unit/files/datasets/test_get.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
import re
21
from unittest import TestCase, mock
3-
4-
from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets
2+
from zowe.zos_files_for_zowe_sdk import Files
3+
from unit.files.constants import profile
54

65

76
class TestGetClass(TestCase):
87
"""File class unit tests."""
98

109
def setUp(self):
1110
"""Setup fixtures for File class."""
12-
self.test_profile = {
13-
"host": "mock-url.com",
14-
"user": "Username",
15-
"password": "Password",
16-
"port": 443,
17-
"rejectUnauthorized": True,
18-
}
11+
self.test_profile = profile
1912

2013
@mock.patch("requests.Session.send")
2114
def test_get(self, mock_send_request):

tests/unit/files/datasets/test_list.py

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
1-
"""Unit tests for the Zowe Python SDK z/OS Files package."""
2-
import re
31
from unittest import TestCase, mock
4-
5-
from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets
2+
from zowe.zos_files_for_zowe_sdk import Files
3+
from unit.files.constants import profile
64

75

86
class TestFilesClass(TestCase):
97
"""File class unit tests."""
108

119
def setUp(self):
1210
"""Setup fixtures for File class."""
13-
self.test_profile = {
14-
"host": "mock-url.com",
15-
"user": "Username",
16-
"password": "Password",
17-
"port": 443,
18-
"rejectUnauthorized": True,
19-
}
11+
self.test_profile = profile
2012

2113
@mock.patch("requests.Session.send")
2214
def test_list_dsn(self, mock_send_request):

tests/unit/files/datasets/test_migrate.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
import re
21
from unittest import TestCase, mock
3-
4-
from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets
2+
from zowe.zos_files_for_zowe_sdk import Files
3+
from unit.files.constants import profile
54

65

76
class TestCreateClass(TestCase):
87
"""File class unit tests."""
98

109
def setUp(self):
1110
"""Setup fixtures for File class."""
12-
self.test_profile = {
13-
"host": "mock-url.com",
14-
"user": "Username",
15-
"password": "Password",
16-
"port": 443,
17-
"rejectUnauthorized": True,
18-
}
11+
self.test_profile = profile
1912

2013
@mock.patch("requests.Session.send")
2114
def test_recall_migrated_dataset(self, mock_send_request):

tests/unit/files/datasets/test_rename.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
import re
22
from unittest import TestCase, mock
3-
4-
from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets
3+
from zowe.zos_files_for_zowe_sdk import Files
4+
from unit.files.constants import profile
55

66

77
class TestCreateClass(TestCase):
88
"""File class unit tests."""
99

1010
def setUp(self):
1111
"""Setup fixtures for File class."""
12-
self.test_profile = {
13-
"host": "mock-url.com",
14-
"user": "Username",
15-
"password": "Password",
16-
"port": 443,
17-
"rejectUnauthorized": True,
18-
}
12+
self.test_profile = profile
1913

2014
@mock.patch("requests.Session.send")
2115
def test_rename_dataset(self, mock_send_request):

tests/unit/files/datasets/test_write.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
import re
21
from unittest import TestCase, mock
3-
4-
from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets
2+
from zowe.zos_files_for_zowe_sdk import Files
3+
from unit.files.constants import profile
54

65

76
class TestWriteClass(TestCase):
87
"""File class unit tests."""
98

109
def setUp(self):
1110
"""Setup fixtures for File class."""
12-
self.test_profile = {
13-
"host": "mock-url.com",
14-
"user": "Username",
15-
"password": "Password",
16-
"port": 443,
17-
"rejectUnauthorized": True,
18-
}
11+
self.test_profile = profile
1912

2013
@mock.patch("requests.Session.send")
2114
def test_write(self, mock_send_request):

tests/unit/files/file_systems/test_file_systems.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
"""Unit tests for the Zowe Python SDK z/OS Files package."""
2-
import re
32
from unittest import TestCase, mock
4-
5-
from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets
3+
from zowe.zos_files_for_zowe_sdk import Files, exceptions
4+
from unit.files.constants import profile
65

76

87
class TestFilesClass(TestCase):
98
"""File class unit tests."""
109

1110
def setUp(self):
1211
"""Setup fixtures for File class."""
13-
self.test_profile = {
14-
"host": "mock-url.com",
15-
"user": "Username",
16-
"password": "Password",
17-
"port": 443,
18-
"rejectUnauthorized": True,
19-
}
12+
self.test_profile = profile
2013

2114
@mock.patch("requests.Session.send")
2215
def test_create_zFS_file_system(self, mock_send_request):

tests/unit/files/uss/test_uss.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
"""Unit tests for the Zowe Python SDK z/OS Files package."""
2-
import re
32
from unittest import TestCase, mock
4-
5-
from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets
3+
from zowe.zos_files_for_zowe_sdk import Files
4+
from unit.files.constants import profile
65

76

87
class TestFilesClass(TestCase):
98
"""File class unit tests."""
109

1110
def setUp(self):
1211
"""Setup fixtures for File class."""
13-
self.test_profile = {
14-
"host": "mock-url.com",
15-
"user": "Username",
16-
"password": "Password",
17-
"port": 443,
18-
"rejectUnauthorized": True,
19-
}
12+
self.test_profile = profile
2013

2114
@mock.patch("requests.Session.send")
2215
def test_delete_uss(self, mock_send_request):

tests/unit/test_zos_console.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import unittest
44
from unittest import mock
5-
5+
from unit.files.constants import profile
66
from zowe.zos_console_for_zowe_sdk import Console
77

88

@@ -11,13 +11,7 @@ class TestConsoleClass(unittest.TestCase):
1111

1212
def setUp(self):
1313
"""Setup fixtures for Console class."""
14-
self.session_details = {
15-
"host": "mock-url.com",
16-
"user": "Username",
17-
"password": "Password",
18-
"port": 443,
19-
"rejectUnauthorized": True,
20-
}
14+
self.session_details = profile
2115

2216
def test_object_should_be_instance_of_class(self):
2317
"""Created object should be instance of Console class."""

tests/unit/test_zos_jobs.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Unit tests for the Zowe Python SDK z/OS Jobs package."""
22

33
from unittest import TestCase, mock
4-
4+
from unit.files.constants import profile
55
from zowe.zos_jobs_for_zowe_sdk import Jobs
66

77

@@ -10,13 +10,7 @@ class TestJobsClass(TestCase):
1010

1111
def setUp(self):
1212
"""Setup fixtures for Jobs class."""
13-
self.test_profile = {
14-
"host": "mock-url.com",
15-
"user": "Username",
16-
"password": "Password",
17-
"port": 443,
18-
"rejectUnauthorized": True,
19-
}
13+
self.test_profile = profile
2014

2115
def test_object_should_be_instance_of_class(self):
2216
"""Created object should be instance of Jobs class."""

tests/unit/test_zos_tso.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Unit tests for the Zowe Python SDK z/OS TSO package."""
22

33
from unittest import TestCase, mock
4-
4+
from unit.files.constants import profile
55
from zowe.zos_tso_for_zowe_sdk import Tso
66

77

@@ -10,13 +10,7 @@ class TestTsoClass(TestCase):
1010

1111
def setUp(self):
1212
"""Setup fixtures for Tso class."""
13-
self.test_profile = {
14-
"host": "mock-url.com",
15-
"user": "Username",
16-
"password": "Password",
17-
"port": 443,
18-
"rejectUnauthorized": True,
19-
}
13+
self.test_profile = profile
2014

2115
def test_object_should_be_instance_of_class(self):
2216
"""Created object should be instance of Tso class."""

tests/unit/test_zosmf.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import unittest
44
from unittest import mock
5-
5+
from unit.files.constants import profile
66
from zowe.zosmf_for_zowe_sdk import Zosmf
77

88

@@ -11,13 +11,7 @@ class TestZosmfClass(unittest.TestCase):
1111

1212
def setUp(self):
1313
"""Setup fixtures for Zosmf class."""
14-
self.connection_dict = {
15-
"host": "mock-url.com",
16-
"user": "Username",
17-
"password": "Password",
18-
"port": 443,
19-
"rejectUnauthorized": True,
20-
}
14+
self.connection_dict = profile
2115

2216
def test_object_should_be_instance_of_class(self):
2317
"""Created object should be instance of Zosmf class."""

0 commit comments

Comments
 (0)