From 2d600d3fc4a386af69d20fba433843b4df2b3c92 Mon Sep 17 00:00:00 2001 From: "D.B. Tsai" Date: Sun, 26 Aug 2012 17:15:26 -0700 Subject: Fixed Wrong ordering of candidates See https://github.com/dbtsai/python-mimeparse/issues/3 mimeparse.best_match(["image/jpeg", "text/plain"], "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5") Expected: 'image/jpeg' Instead: 'text/plain' --- testdata.json | 1 + 1 file changed, 1 insertion(+) (limited to 'testdata.json') diff --git a/testdata.json b/testdata.json index 330a7fb..7a84b39 100644 --- a/testdata.json +++ b/testdata.json @@ -32,6 +32,7 @@ [[["application/json", "text/html"], "application/json, text/html;q=0.9"], "application/json", "verify fitness ordering"], [[["image/*", "application/xml"], "image/png"], "image/*", "match using a type wildcard"], [[["image/*", "application/xml"], "image/*"], "image/*", "match using a wildcard for both requested and supported"], + [[["image/jpeg", "text/plain"], "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5"], "image/jpeg", "media type with highest associated quality factor should win, not necessarily most specific"], [[["text/html", "application/rdf+xml"], "text/html, application/rdf+xml"], "application/rdf+xml", "match should use highest order of supported when there is a tie"], [[["application/rdf+xml", "text/html"], "text/html, application/rdf+xml"], "text/html", "match should use highest order of supported when there is a tie"] ], -- cgit v1.2.1