From 436fb6694fc5172a9b64a1a732f7930f45cb6c6c Mon Sep 17 00:00:00 2001 From: LETORT Sebastien <sebastien.letort@irisa.fr> Date: Thu, 9 Jan 2020 14:12:11 +0100 Subject: [PATCH] new unit test for StatusError (minor) --- tests/test_allgo.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_allgo.py b/tests/test_allgo.py index d25a691..2362ffc 100644 --- a/tests/test_allgo.py +++ b/tests/test_allgo.py @@ -18,6 +18,23 @@ else: import allgo # I need to modify constant from allgo import * +# ================================================ +class TestStatusError: + + REF_MSG = "whatever, an error message." + + @pytest.fixture + def response(self): + m = Mock() + m.json.return_value = \ + { 'error': self.REF_MSG } + return m + + @pytest.mark.dbg + def test_msg(self, response): + err = StatusError(42, response) + assert self.REF_MSG == err.msg + # ================================================ @pytest.fixture(scope="module") -- GitLab