test/api: check api.exception exits the process

The `api.exception` method, which is internally also used by
`api.exception_handler` helper, calls `sys.exit` and this no
statement after a call to either method should be reached.
Add an assertion to make sure of that.
This commit is contained in:
Christian Kellner 2020-10-07 14:57:10 +02:00
parent 78d72eded9
commit 17fbe41b03

View file

@ -89,6 +89,7 @@ class TestAPI(unittest.TestCase):
def exception(path):
with osbuild.api.exception_handler(path):
raise ValueError("osbuild test exception")
assert False, "api.exception should exit process"
api = osbuild.api.API(args, monitor, socket_address=path)
with api: