Skip to content
Myr

test_help.py

This file

Path

tests/test_help.py

27 lines · 839 bytes · Python

Last changed by

Remove pytest-mock requirement (#6505)Nate Prewittbefore adoption005571d

History of this file

Take it

The walk stopped after 200 commits: lines older than 1f7c888 point at it.

Remove pytest-mock requirement (#6505)Nate Prewittbefore adoption005571d

lines 1–2why, one step back
1from unittest import mock
2

Merge pull request #5570 from ajorg-aws/masterNate Prewittbefore adoption1f7c888

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

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

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

Merge pull request #5570 from ajorg-aws/masterNate Prewittbefore adoption1f7c888

lines 9–10why, one step back
9
10

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

line 11why, one step back
11class VersionedPackage:

Merge pull request #5570 from ajorg-aws/masterNate Prewittbefore adoption1f7c888

lines 12–15why, one step back
12 def __init__(self, version):
13 self.__version__ = version1415

Remove pytest-mock requirement (#6505)Nate Prewittbefore adoption005571d

line 16why, one step back
16def test_idna_without_version_attribute():

Merge pull request #5570 from ajorg-aws/masterNate Prewittbefore adoption1f7c888

lines 17–19why, one step back
17 """Older versions of IDNA don't provide a __version__ attribute, verify
18 that if we have such a package, we don't blow up.19 """

Remove pytest-mock requirement (#6505)Nate Prewittbefore adoption005571d

lines 20–21why, one step back
20 with mock.patch("requests.help.idna", new=None):
21 assert info()["idna"] == {"version": ""}

Merge pull request #5570 from ajorg-aws/masterNate Prewittbefore adoption1f7c888

lines 22–23why, one step back
22
23

Remove pytest-mock requirement (#6505)Nate Prewittbefore adoption005571d

line 24why, one step back
24def test_idna_with_version_attribute():

Merge pull request #5570 from ajorg-aws/masterNate Prewittbefore adoption1f7c888

line 25why, one step back
25 """Verify we're actually setting idna version when it should be available."""

Remove pytest-mock requirement (#6505)Nate Prewittbefore adoption005571d

lines 26–27why, one step back
26 with mock.patch("requests.help.idna", new=VersionedPackage("2.6")):
27 assert info()["idna"] == {"version": "2.6"}