Skip to content

Commit

Permalink
Fix Python exception test cross failure (#2593)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone authored Aug 1, 2024
1 parent b38df0a commit 2f63b48
Showing 1 changed file with 37 additions and 35 deletions.
72 changes: 37 additions & 35 deletions python/test/Ice/exceptions/AllTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,44 +839,46 @@ def allTests(helper, communicator):
pass
print("ok")

sys.stdout.write("testing exceptions in request failed exception... ")
sys.stdout.write("testing setting RFE exception fields from Python... ")
sys.stdout.flush()
try:
thrower.throwRequestFailedException(
"Ice.ObjectNotExistException",
Ice.Identity("name", "category"),
"facet",
"operation")
test(False)
except Ice.ObjectNotExistException as ex:
test(ex.id == Ice.Identity("name", "category"))
test(ex.facet == "facet")
test(ex.operation == "operation")

try:
thrower.throwRequestFailedException(
"Ice.OperationNotExistException",
Ice.Identity("name", "category"),
"facet",
"operation")
test(False)
except Ice.OperationNotExistException as ex:
test(ex.id == Ice.Identity("name", "category"))
test(ex.facet == "facet")
test(ex.operation == "operation")

try:
thrower.throwRequestFailedException(
"Ice.FacetNotExistException",
Ice.Identity("name", "category"),
"facet",
"operation")
test(False)
except Ice.FacetNotExistException as ex:
test(ex.id == Ice.Identity("name", "category"))
test(ex.facet == "facet")
test(ex.operation == "operation")
try:
thrower.throwRequestFailedException(
"Ice.ObjectNotExistException",
Ice.Identity("name", "category"),
"facet",
"operation")
test(False)
except Ice.ObjectNotExistException as ex:
test(ex.id == Ice.Identity("name", "category"))
test(ex.facet == "facet")
test(ex.operation == "operation")

try:
thrower.throwRequestFailedException(
"Ice.OperationNotExistException",
Ice.Identity("name", "category"),
"facet",
"operation")
test(False)
except Ice.OperationNotExistException as ex:
test(ex.id == Ice.Identity("name", "category"))
test(ex.facet == "facet")
test(ex.operation == "operation")

try:
thrower.throwRequestFailedException(
"Ice.FacetNotExistException",
Ice.Identity("name", "category"),
"facet",
"operation")
test(False)
except Ice.FacetNotExistException as ex:
test(ex.id == Ice.Identity("name", "category"))
test(ex.facet == "facet")
test(ex.operation == "operation")
except Ice.OperationNotExistException:
# Only implemented in Python
pass
print("ok")
return thrower

0 comments on commit 2f63b48

Please sign in to comment.