Skip to content

Commit

Permalink
Accept multiple error codes descriptions in test_error_message (#2008)
Browse files Browse the repository at this point in the history
  • Loading branch information
ni-jfitzger authored Sep 9, 2023
1 parent 6ded97d commit 2efbbc7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/nifgen/system_tests/test_system_nifgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,15 @@ def test_error_message(self, session_creation_kwargs):
with nifgen.Session('', '0', False, 'Simulate=1, DriverSetup=Model:invalid_model (2CH);BoardType:PXIe', **session_creation_kwargs):
assert False
except nifgen.Error as e:
assert e.code == -1074134944
assert e.description.find('Insufficient location information or resource not present in the system.') != -1
# The returned error has changed over time, so accept multiple error codes, descriptions.
# Users should generally not look for specific error codes and should instead correct their code if they hit an error.
assert e.code in [-1074134944, -1074134964]
assert any(
[
e.description.find('Insufficient location information or resource not present in the system.') != -1,
e.description.find('The option string parameter contains an entry with an unknown option value.') != -1,
]
)

def test_get_error(self, session):
try:
Expand Down

0 comments on commit 2efbbc7

Please sign in to comment.