示例#1
0
    def test_check_status_expect(self):
        api = MockApi(200)
        resp = MockResp(200)
        resp.caller = api
        resp.input_kwargs = None

        Consumer._check_status(resp)
示例#2
0
    def test_check_status_code_is_str(self):
        api = MockApi(200)
        resp = MockResp('200')

        resp.caller = api
        resp.input_kwargs = None

        Consumer._check_status(resp)
示例#3
0
    def test_check_status_not_expect(self):
        api = MockApi(200)
        resp = MockResp(401)
        resp.caller = api
        resp.input_kwargs = None

        with self.assertRaises(StatusCodeUnexpectedError):
            Consumer._check_status(resp)