def test_raise_error_if_call_http_result_is_invalid_structure(): responses.add(responses.GET, 'http://10.0.0.1/api/foo/bar', status=200, body='{}') with pytest.raises(PresenceError) as pe: presence.call_http('GET', 'http://10.0.0.1/api/foo/bar')
def test_raise_error_if_call_http_result_is_invalid_structure(): responses.add(responses.GET, 'http://10.0.0.1/api/foo/bar', status=200, body='{"external_address": "10.0.0.2"}') data = presence.call_http('GET', 'http://10.0.0.1/api/foo/bar') assert data == {'external_address': '10.0.0.2'}
def test_raise_error_if_call_http_result_is_invalid_structure(): responses.add(responses.GET, "http://10.0.0.1/api/foo/bar", status=200, body='{"external_address": "10.0.0.2"}') data = presence.call_http("GET", "http://10.0.0.1/api/foo/bar") assert data == {"external_address": "10.0.0.2"}
def test_raise_error_if_call_http_result_is_invalid_structure(): responses.add(responses.GET, "http://10.0.0.1/api/foo/bar", status=200, body="{}") with pytest.raises(PresenceError) as pe: presence.call_http("GET", "http://10.0.0.1/api/foo/bar")