Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 436fb669 authored by LETORT Sebastien's avatar LETORT Sebastien
Browse files

new unit test for StatusError (minor)

parent 5ce186b7
No related branches found
No related tags found
2 merge requests!4Client api,!2Continuous integration, more tests
...@@ -18,6 +18,23 @@ else: ...@@ -18,6 +18,23 @@ else:
import allgo # I need to modify constant import allgo # I need to modify constant
from allgo import * 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") @pytest.fixture(scope="module")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment