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