Skip to content
Myr

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 file

Take it

The walk stopped after 200 commits: lines older than 782e94d point at it.

Update example code in README.md (#5292)John Kookerbefore adoption782e94d

lines 1–5why, one step back
1from requests.help import info
234def test_system_ssl():5 """Verify we're actually setting system_ssl when it should be available."""

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

line 6why, one step back
6 assert info()["system_ssl"]["version"] != ""

Update example code in README.md (#5292)John Kookerbefore adoption782e94d

lines 7–8why, one step back
7
8

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

line 9why, one step back
9class VersionedPackage:

Update example code in README.md (#5292)John Kookerbefore adoption782e94d

lines 10–17why, one step back
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 """

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

lines 18–19why, one step back
18 mocker.patch("requests.help.idna", new=None)
19 assert info()["idna"] == {"version": ""}

Update example code in README.md (#5292)John Kookerbefore adoption782e94d

lines 20–23why, one step back
20
2122def test_idna_with_version_attribute(mocker):23 """Verify we're actually setting idna version when it should be available."""

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

lines 24–25why, one step back
24 mocker.patch("requests.help.idna", new=VersionedPackage("2.6"))
25 assert info()["idna"] == {"version": "2.6"}