Exemplo n.º 1
0
def test_get_render_only_decoder():
    with pytest.raises(UnsupportedContentType):
        negotiate_decoder('text/html')
Exemplo n.º 2
0
def test_get_unsupported_decoder():
    with pytest.raises(UnsupportedContentType):
        negotiate_decoder('application/csv')
Exemplo n.º 3
0
def test_get_supported_decoder():
    assert isinstance(negotiate_decoder('application/vnd.coreapi+json'), CoreJSONCodec)
Exemplo n.º 4
0
def test_get_supported_decoder_with_parameters():
    assert isinstance(negotiate_decoder('application/vnd.coreapi+json; verison=1.0'), CoreJSONCodec)
Exemplo n.º 5
0
def test_get_default_decoder():
    assert isinstance(negotiate_decoder(), CoreJSONCodec)