summaryrefslogtreecommitdiff
path: root/testdata.json
diff options
context:
space:
mode:
authorD.B. Tsai <dbtsai@dbtsai.com>2012-08-26 17:15:26 -0700
committerD.B. Tsai <dbtsai@dbtsai.com>2012-08-27 20:03:06 -0700
commit2d600d3fc4a386af69d20fba433843b4df2b3c92 (patch)
tree448829c54d645a9331492b34a27c12861402f7ee /testdata.json
parent67b1d8bce8e41a77ee19038453b3ecdb85708f2a (diff)
downloadpython-mimeparse-2d600d3fc4a386af69d20fba433843b4df2b3c92.tar.gz
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'
Diffstat (limited to 'testdata.json')
-rw-r--r--testdata.json1
1 files changed, 1 insertions, 0 deletions
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"]
],