File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 2626 include_package_data = True ,
2727 python_requires = ">=3.7" ,
2828 install_requires = requirements ,
29- tests_require = ["mocket>=3.8.9 " ],
29+ tests_require = ["mocket>=3.11.0 " ],
3030 test_suite = "tests" ,
3131 license = geoip2 .__license__ ,
3232 classifiers = [
Original file line number Diff line number Diff line change @@ -298,16 +298,18 @@ def test_request(self):
298298 self .assertEqual (
299299 request .path , "/geoip/v2.1/country/1.2.3.4" , "correct URI is used"
300300 )
301- self .assertEqual (
302- request .headers ["Accept" ], "application/json" , "correct Accept header"
303- )
301+
302+ # This is to prevent breakage if header normalization in Mocket
303+ # changes again in the future.
304+ headers = {k .lower (): v for k , v in request .headers .items ()}
305+ self .assertEqual (headers ["accept" ], "application/json" , "correct Accept header" )
304306 self .assertRegex (
305- request . headers ["User-Agent " ],
307+ headers ["user-agent " ],
306308 "^GeoIP2-Python-Client/" ,
307309 "Correct User-Agent" ,
308310 )
309311 self .assertEqual (
310- request . headers ["Authorization " ],
312+ headers ["authorization " ],
311313 "Basic NDI6YWJjZGVmMTIzNDU2" ,
312314 "correct auth" ,
313315 )
You can’t perform that action at this time.
0 commit comments