test/api: assert return code for api.exception

Check that the exit code for `api.exception`, called via the
`api.exception_handler` helper, is the correct one.
This commit is contained in:
Christian Kellner 2020-10-07 17:44:20 +02:00
parent aaa51e22a6
commit 71f7bf8930

View file

@ -95,6 +95,7 @@ class TestAPI(unittest.TestCase):
p = mp.Process(target=exception, args=(path, ))
p.start()
p.join()
self.assertEqual(p.exitcode, 2)
self.assertIsNotNone(api.error, "Error not set")
self.assertIn("type", api.error, "Error has no 'type' set")
self.assertEqual("exception", api.error["type"], "Not an exception")