def test_choose_query_mimetype():
    formats_map = {'json': 'application/json', 'marcxml': 'application/marcxml+xml'}
    fmt = 'marcxml'
    assert ('application/marcxml+xml' == ContentNegotiator.match_by_format(formats_map, fmt))
    fmt = 'json'
    assert ('application/json' == ContentNegotiator.match_by_format(formats_map, fmt))
    fmt = 'foo'
    mime_type = ContentNegotiator.match_by_format(formats_map, fmt)
    assert (mime_type is None)
def test_choose_query_mimetype():
    formats_map = {'json': 'application/json', 'marcxml': 'application/marcxml+xml'}
    fmt = 'marcxml'
    assert ('application/marcxml+xml' == ContentNegotiator.match_by_format(formats_map, fmt))
    fmt = 'json'
    assert ('application/json' == ContentNegotiator.match_by_format(formats_map, fmt))
    fmt = 'foo'
    mime_type = ContentNegotiator.match_by_format(formats_map, fmt)
    assert (mime_type is None)