Skip to content

Commit

Permalink
Update error message
Browse files Browse the repository at this point in the history
Signed-off-by: pem70 <[email protected]>
  • Loading branch information
pem70 committed Jun 18, 2024
1 parent 932be84 commit 3985ba8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/zos_files/zowe/zos_files_for_zowe_sdk/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def dsorg(self) -> Optional[str]:
@dsorg.setter
def dsorg(self, dsorg: Optional[str]):
if dsorg not in ("PO", "PS", None):
raise ValueError("")
raise ValueError("'dsorg' must be 'PO', 'PS', or None")
self.__dsorg = dsorg

@property
Expand All @@ -96,7 +96,7 @@ def alcunit(self, alcunit: Optional[str]):
else:
self.__alcunit = "TRK"

Check warning on line 97 in src/zos_files/zowe/zos_files_for_zowe_sdk/datasets.py

View check run for this annotation

Codecov / codecov/patch

src/zos_files/zowe/zos_files_for_zowe_sdk/datasets.py#L97

Added line #L97 was not covered by tests
elif alcunit not in ("CYL", "TRK"):
raise KeyError
raise KeyError("'alcunit' must be 'CYL' or 'TRK'")
else:
self.__alcunit = alcunit

Expand All @@ -108,7 +108,7 @@ def primary(self) -> Optional[int]:
def primary(self, primary: Optional[int]):
if primary is not None:
if primary > 16777215:
raise ValueError
raise ValueError("Given primary space allocation exceeds track limit of 16,777,215")
self.__primary = primary

@property
Expand All @@ -120,7 +120,7 @@ def secondary(self, secondary: Optional[int]):
if self.primary is not None:
secondary = secondary if secondary is not None else int(self.primary / 10)
if secondary > 16777215:
raise ValueError
raise ValueError("Given secondary space allocation exceeds track limit of 16,777,215")
self.__secondary = secondary

@property
Expand Down Expand Up @@ -151,7 +151,9 @@ def recfm(self, recfm: Optional[str]):
else:
self.__recfm = "F"

Check warning on line 152 in src/zos_files/zowe/zos_files_for_zowe_sdk/datasets.py

View check run for this annotation

Codecov / codecov/patch

src/zos_files/zowe/zos_files_for_zowe_sdk/datasets.py#L152

Added line #L152 was not covered by tests
elif recfm not in ("F", "FB", "V", "VB", "U", "FBA", "FBM", "VBA", "VBM"):
raise KeyError
raise KeyError(
"'recfm' must be one of the following: 'F', 'FB', 'V', 'VB', 'U', 'FBA', 'FBM', 'VBA', 'VBM'"
)
else:
self.__recfm = recfm

Expand Down

0 comments on commit 3985ba8

Please sign in to comment.