test_help.py
This file
Path
tests/test_help.py
25 lines · 808 bytes · Python
Last changed by
Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
History of this fileTake it
1from requests.help import info234def test_system_ssl():5 """Verify we're actually setting system_ssl when it should be available."""6 assert info()["system_ssl"]["version"] != ""789class VersionedPackage:10 def __init__(self, version):11 self.__version__ = version121314def test_idna_without_version_attribute(mocker):15 """Older versions of IDNA don't provide a __version__ attribute, verify16 that if we have such a package, we don't blow up.17 """18 mocker.patch("requests.help.idna", new=None)19 assert info()["idna"] == {"version": ""}202122def test_idna_with_version_attribute(mocker):23 """Verify we're actually setting idna version when it should be available."""24 mocker.patch("requests.help.idna", new=VersionedPackage("2.6"))25 assert info()["idna"] == {"version": "2.6"}