Skip to content

Commit

Permalink
Revert "Merge branch 'convert_windows_line_ending' into TSO"
Browse files Browse the repository at this point in the history
This reverts commit 2326a40, reversing
changes made to 85d84c8.

Signed-off-by: pem70 <[email protected]>
  • Loading branch information
pem70 committed Jun 7, 2024
1 parent 2326a40 commit 3de32d1
Show file tree
Hide file tree
Showing 17 changed files with 134 additions and 47 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ All notable changes to the Zowe Client Python SDK will be documented in this fil

### Enhancements

- Added logger class to core SDK [#185](https://github.com/zowe/zowe-client-python-sdk/issues/185)
- Added logger class to core SDK [#185](https://github.com/zowe/zowe-client-python-sdk/issues/185)
- 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)
- Refactored testings into proper folders and files and add more tests [#265](https://github.com/zowe/zowe-client-python-sdk/issues/265)
Expand Down
1 change: 1 addition & 0 deletions src/zos_files/zowe/zos_files_for_zowe_sdk/uss.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def get_content(self, filepath_name):
A JSON with the contents of the specified USS file
"""
custom_args = self._create_custom_request_arguments()
# custom_args["params"] = {"filepath-name": filepath_name}
custom_args["url"] = "{}fs{}".format(self.request_endpoint, filepath_name)
response_json = self.request_handler.perform_request("GET", custom_args)
return response_json
Expand Down
7 changes: 0 additions & 7 deletions tests/unit/files/constants.py

This file was deleted.

13 changes: 10 additions & 3 deletions tests/unit/files/datasets/test_copy.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import re
from unittest import TestCase, mock
from zowe.zos_files_for_zowe_sdk import Files
from unit.files.constants import profile

from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets


class TestCreateClass(TestCase):
"""File class unit tests."""

def setUp(self):
"""Setup fixtures for File class."""
self.test_profile = profile
self.test_profile = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

@mock.patch("requests.Session.send")
def test_copy_uss_to_dataset(self, mock_send_request):
Expand Down
13 changes: 10 additions & 3 deletions tests/unit/files/datasets/test_create.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import re
from unittest import TestCase, mock
from zowe.zos_files_for_zowe_sdk import Files
from unit.files.constants import profile

from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets


class TestCreateClass(TestCase):
"""File class unit tests."""

def setUp(self):
"""Setup fixtures for File class."""
self.test_profile = profile
self.test_profile = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

@mock.patch("requests.Session.send")
def test_create_data_set_accept_valid_recfm(self, mock_send_request):
Expand Down
15 changes: 11 additions & 4 deletions tests/unit/files/datasets/test_delete.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import re
from unittest import TestCase, mock
from zowe.zos_files_for_zowe_sdk import Files
from unit.files.constants import profile

from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets


class TestDeleteClass(TestCase):
"""File class unit tests."""

def setUp(self):
"""Setup fixtures for File class."""
self.test_profile = profile
self.test_profile = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

@mock.patch("requests.Session.send")
def test_delete(self, mock_send_request):
Expand All @@ -19,7 +26,7 @@ def test_delete(self, mock_send_request):
mock_send_request.assert_called_once()

@mock.patch("requests.Session.send")
def test_delete_param(self, mock_send_request):
def test_delete_pram(self, mock_send_request):
"""Test list members sends request"""
self.files_instance = Files(self.test_profile)
mock_send_request.return_value = mock.Mock(headers={"Content-Type": "application/json"}, status_code=200)
Expand Down
13 changes: 10 additions & 3 deletions tests/unit/files/datasets/test_get.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import re
from unittest import TestCase, mock
from zowe.zos_files_for_zowe_sdk import Files
from unit.files.constants import profile

from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets


class TestGetClass(TestCase):
"""File class unit tests."""

def setUp(self):
"""Setup fixtures for File class."""
self.test_profile = profile
self.test_profile = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

@mock.patch("requests.Session.send")
def test_get(self, mock_send_request):
Expand Down
14 changes: 11 additions & 3 deletions tests/unit/files/datasets/test_list.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
"""Unit tests for the Zowe Python SDK z/OS Files package."""
import re
from unittest import TestCase, mock
from zowe.zos_files_for_zowe_sdk import Files
from unit.files.constants import profile

from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets


class TestFilesClass(TestCase):
"""File class unit tests."""

def setUp(self):
"""Setup fixtures for File class."""
self.test_profile = profile
self.test_profile = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

@mock.patch("requests.Session.send")
def test_list_dsn(self, mock_send_request):
Expand Down
13 changes: 10 additions & 3 deletions tests/unit/files/datasets/test_migrate.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import re
from unittest import TestCase, mock
from zowe.zos_files_for_zowe_sdk import Files
from unit.files.constants import profile

from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets


class TestCreateClass(TestCase):
"""File class unit tests."""

def setUp(self):
"""Setup fixtures for File class."""
self.test_profile = profile
self.test_profile = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

@mock.patch("requests.Session.send")
def test_recall_migrated_dataset(self, mock_send_request):
Expand Down
12 changes: 9 additions & 3 deletions tests/unit/files/datasets/test_rename.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import re
from unittest import TestCase, mock
from zowe.zos_files_for_zowe_sdk import Files
from unit.files.constants import profile

from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets


class TestCreateClass(TestCase):
"""File class unit tests."""

def setUp(self):
"""Setup fixtures for File class."""
self.test_profile = profile
self.test_profile = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

@mock.patch("requests.Session.send")
def test_rename_dataset(self, mock_send_request):
Expand Down
13 changes: 10 additions & 3 deletions tests/unit/files/datasets/test_write.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import re
from unittest import TestCase, mock
from zowe.zos_files_for_zowe_sdk import Files
from unit.files.constants import profile

from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets


class TestWriteClass(TestCase):
"""File class unit tests."""

def setUp(self):
"""Setup fixtures for File class."""
self.test_profile = profile
self.test_profile = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

@mock.patch("requests.Session.send")
def test_write(self, mock_send_request):
Expand Down
13 changes: 10 additions & 3 deletions tests/unit/files/file_systems/test_file_systems.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
"""Unit tests for the Zowe Python SDK z/OS Files package."""
import re
from unittest import TestCase, mock
from zowe.zos_files_for_zowe_sdk import Files, exceptions
from unit.files.constants import profile

from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets


class TestFilesClass(TestCase):
"""File class unit tests."""

def setUp(self):
"""Setup fixtures for File class."""
self.test_profile = profile
self.test_profile = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

@mock.patch("requests.Session.send")
def test_create_zFS_file_system(self, mock_send_request):
Expand Down
13 changes: 10 additions & 3 deletions tests/unit/files/uss/test_uss.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
"""Unit tests for the Zowe Python SDK z/OS Files package."""
import re
from unittest import TestCase, mock
from zowe.zos_files_for_zowe_sdk import Files
from unit.files.constants import profile

from zowe.zos_files_for_zowe_sdk import Files, exceptions, Datasets


class TestFilesClass(TestCase):
"""File class unit tests."""

def setUp(self):
"""Setup fixtures for File class."""
self.test_profile = profile
self.test_profile = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

@mock.patch("requests.Session.send")
def test_delete_uss(self, mock_send_request):
Expand Down
10 changes: 8 additions & 2 deletions tests/unit/test_zos_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import unittest
from unittest import mock
from unit.files.constants import profile

from zowe.zos_console_for_zowe_sdk import Console


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

def setUp(self):
"""Setup fixtures for Console class."""
self.session_details = profile
self.session_details = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

def test_object_should_be_instance_of_class(self):
"""Created object should be instance of Console class."""
Expand Down
10 changes: 8 additions & 2 deletions tests/unit/test_zos_jobs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Unit tests for the Zowe Python SDK z/OS Jobs package."""

from unittest import TestCase, mock
from unit.files.constants import profile

from zowe.zos_jobs_for_zowe_sdk import Jobs


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

def setUp(self):
"""Setup fixtures for Jobs class."""
self.test_profile = profile
self.test_profile = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

def test_object_should_be_instance_of_class(self):
"""Created object should be instance of Jobs class."""
Expand Down
10 changes: 8 additions & 2 deletions tests/unit/test_zos_tso.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Unit tests for the Zowe Python SDK z/OS TSO package."""

from unittest import TestCase, mock
from unit.files.constants import profile

from zowe.zos_tso_for_zowe_sdk import Tso


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

def setUp(self):
"""Setup fixtures for Tso class."""
self.test_profile = profile
self.test_profile = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

def test_object_should_be_instance_of_class(self):
"""Created object should be instance of Tso class."""
Expand Down
10 changes: 8 additions & 2 deletions tests/unit/test_zosmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import unittest
from unittest import mock
from unit.files.constants import profile

from zowe.zosmf_for_zowe_sdk import Zosmf


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

def setUp(self):
"""Setup fixtures for Zosmf class."""
self.connection_dict = profile
self.connection_dict = {
"host": "mock-url.com",
"user": "Username",
"password": "Password",
"port": 443,
"rejectUnauthorized": True,
}

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

0 comments on commit 3de32d1

Please sign in to comment.