Skip to content
Myr

test_help.py

This file

Path

tests/test_help.py

31 lines · 866 bytes · Python

Last changed by

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

History of this file

Take it

Merge branch 'master' of github.com:kennethreitz/requestsKenneth Reitzbefore adoption649efc8

lines 1–12why, one step back
1# -*- encoding: utf-8
23import sys45import pytest67from requests.help import info8910def test_system_ssl():11 """Verify we're actually setting system_ssl when it should be available."""12 assert info()['system_ssl']['version'] != ''

Merge pull request #4182 from alexwlchan/idna-versionNate Prewittbefore adoptionfdf4261

lines 13–31why, one step back
13
1415class VersionedPackage(object):16 def __init__(self, version):17 self.__version__ = version181920def test_idna_without_version_attribute(mocker):21 """Older versions of IDNA don't provide a __version__ attribute, verify22 that if we have such a package, we don't blow up.23 """24 mocker.patch('requests.help.idna', new=None)25 assert info()['idna'] == {'version': ''}262728def test_idna_with_version_attribute(mocker):29 """Verify we're actually setting idna version when it should be available."""30 mocker.patch('requests.help.idna', new=VersionedPackage('2.6'))31 assert info()['idna'] == {'version': '2.6'}