Exemplo n.º 1
0
def test_parse_response_with_bad_status():
    headers = {
        'livescope-status': '406 Parameter Missing',
        'content-type': 'text/plain',
    }
    response = MockResponse(headers)
    with pytest.raises(exceptions.ParameterMissing):
        parse_response(response)
Exemplo n.º 2
0
def test_parse_response_with_image():
    headers = {
        'livescope-status': '0',
        'content-type': 'image/jpeg',
    }
    response = MockResponse(headers, b'image data goes here')
    assert parse_response(response) == b'image data goes here'
Exemplo n.º 3
0
def test_parse_response_with_parameters():
    headers = {'livescope-status': '0', 'content-type': 'text/plain'}
    response = MockResponse(headers)
    assert parse_response(response) == {}