Skip to content

Commit

Permalink
Add Dataset Covered Profile Testing
Browse files Browse the repository at this point in the history
Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
  • Loading branch information
ElijahSwiftIBM committed Nov 2, 2023
1 parent c8deb71 commit f66964d
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/data_set/test_data_set_result_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@ def test_data_set_admin_thows_error_on_add_existing_data_set_profile(
+ f"'{self.data_set_admin._profile_type}' profile.",
)

def test_dataset_admin_avoids_error_on_add_covered_profile(
self,
call_racf_mock: Mock,
):
call_racf_mock.side_effect = [
TestDataSetConstants.TEST_EXTRACT_DATA_SET_RESULT_GENERIC_BASE_ONLY_SUCCESS_XML,
TestDataSetConstants.TEST_ADD_DATA_SET_RESULT_SUCCESS_XML,
]
self.assertEqual(
self.data_set_admin.add(
"ESWIFT.TEST.T1136242.P3020470",
traits=TestDataSetConstants.TEST_ADD_DATA_SET_REQUEST_TRAITS,
),
TestDataSetConstants.TEST_ADD_DATA_SET_RESULT_SUCCESS_DICTIONARY,
)

# Error in command, ESWIFTTESTT1136242P3020470 is not a valid DATASET
def test_data_set_admin_can_parse_add_data_set_error_xml(
self,
Expand Down Expand Up @@ -125,6 +141,28 @@ def test_data_set_admin_thows_error_on_alter_new_data_set_profile(
+ f"'{self.data_set_admin._profile_type}' profile.",
)

def test_dataset_admin_throws_error_on_alter_covered_profile(
self,
call_racf_mock: Mock,
):
profile_name = "ESWIFT.TEST.T1136242.P3020470"
call_racf_mock.side_effect = [
TestDataSetConstants.TEST_EXTRACT_DATA_SET_RESULT_GENERIC_BASE_ONLY_SUCCESS_XML,
TestDataSetConstants.TEST_ALTER_DATA_SET_RESULT_SUCCESS_XML,
]
with self.assertRaises(AlterOperationError) as exception:
self.data_set_admin.alter(
profile_name,
traits=TestDataSetConstants.TEST_ALTER_DATA_SET_REQUEST_TRAITS,
)
self.assertEqual(
exception.exception.message,
"Refusing to make security request to IRRSMO00."
+ "\n\nTarget profile "
+ f"'{profile_name}' does not exist as a "
+ f"'{self.data_set_admin._profile_type}' profile.",
)

# Error in environment, ESWIFT.TEST.T1136242.P3020470 data set does not exist
def test_data_set_admin_can_parse_alter_data_set_error_xml(
self,
Expand Down

0 comments on commit f66964d

Please sign in to comment.