mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-06 04:19:26 +00:00
23 lines
656 B
Python
23 lines
656 B
Python
from connexion.datastructures import MediaTypeDict
|
|
|
|
|
|
def test_media_type_dict():
|
|
d = MediaTypeDict(
|
|
{
|
|
"*/*": "*/*",
|
|
"*/json": "*/json",
|
|
"*/*json": "*/*json",
|
|
"multipart/*": "multipart/*",
|
|
"multipart/form-data": "multipart/form-data",
|
|
}
|
|
)
|
|
|
|
assert d["application/json"] == "*/json"
|
|
assert d["application/problem+json"] == "*/*json"
|
|
assert d["application/x-www-form-urlencoded"] == "*/*"
|
|
assert d["multipart/form-data"] == "multipart/form-data"
|
|
assert d["multipart/byteranges"] == "multipart/*"
|
|
|
|
# Test __contains__
|
|
assert "application/json" in d
|