File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2242,6 +2242,23 @@ def testAcceptHeaderParsing(self):
22422242 "application/xml")
22432243 '''
22442244
2245+ # TEST #8
2246+ # invalid api version
2247+ # application/json is selected with invalid version
2248+ self .server .client .request .headers .get = self .get_header
2249+ headers = {"accept" : "application/json; version=99"
2250+ }
2251+ self .headers = headers
2252+ with self .assertRaises (UsageError ) as ctx :
2253+ results = self .server .dispatch ('GET' ,
2254+ "/rest/data/status/1" ,
2255+ self .empty_form )
2256+ print (results )
2257+ self .assertEqual (self .server .client .response_code , 200 )
2258+ self .assertEqual (ctx .exception .args [0 ],
2259+ "Unrecognized version: 99. See /rest without "
2260+ "specifying version for supported versions." )
2261+
22452262 def testMethodOverride (self ):
22462263 # TEST #1
22472264 # Use GET, PUT, PATCH to tunnel DELETE expect error
You can’t perform that action at this time.
0 commit comments