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