From b34dcf6a731d45c4e3e82767358d912803d1d5db Mon Sep 17 00:00:00 2001 From: nanoric Date: Wed, 10 Oct 2018 22:26:45 -0400 Subject: [PATCH] =?UTF-8?q?[Mod]=20Test=E4=BD=BF=E7=94=A8with=20promise.ca?= =?UTF-8?q?tch():=E8=AF=AD=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/network/RestfulClientTest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/network/RestfulClientTest.py b/tests/network/RestfulClientTest.py index cba63063..9aa711f4 100644 --- a/tests/network/RestfulClientTest.py +++ b/tests/network/RestfulClientTest.py @@ -28,10 +28,11 @@ class TestRestClient(RestClient): return req def onError(self, exceptionType, exceptionValue, tb, req): - self.p.set_exception(exceptionValue) + self.p.set_exception(exceptionType, exceptionValue, tb) def onFailed(self, httpStatusCode, req): - self.p.set_exception(FailedError("request failed")) + with self.p.catch(): + raise FailedError("request failed") class RestfulClientTest(unittest.TestCase):