def test_favour_quality_over_same_specificity():
    server_mimetypes = ['application/json', 'application/marcxml+xml']
    client_mimetypes = parse_accept_header('application/json;q=0.5, application/marcxml+xml', MIMEAccept)
    assert ('application/marcxml+xml' == ContentNegotiator.match_by_accept(server_mimetypes, client_mimetypes))
    client_mimetypes = parse_accept_header('application/marcxml+xml;q=0.4, application/json;q=0.6', MIMEAccept)
    assert ('application/json' == ContentNegotiator.match_by_accept(server_mimetypes, client_mimetypes))
def test_favour_quality_over_same_specificity():
    server_mimetypes = ['application/json', 'application/marcxml+xml']
    client_mimetypes = parse_accept_header('application/json;q=0.5, application/marcxml+xml', MIMEAccept)
    assert ('application/marcxml+xml' == ContentNegotiator.match_by_accept(server_mimetypes, client_mimetypes))
    client_mimetypes = parse_accept_header('application/marcxml+xml;q=0.4, application/json;q=0.6', MIMEAccept)
    assert ('application/json' == ContentNegotiator.match_by_accept(server_mimetypes, client_mimetypes))