To confirm urllib3.disable_warnins is not called without relying on log messages:
python <<EOF import requests.packages.urllib3 from cephclient.wrapper import CephWrapper def override(calls=[], query=False, func=requests.packages.urllib3.disable_warnings): if query: return len(calls) return calls.append(func()) requests.packages.urllib3.disable_warnings=override CephWrapper().osd_df() assert(requests.packages.urllib3.disable_warnings(query=True) == 0) EOF
should not print AssertionError.
(python mock is not available on controller; this snippet patches disable_warnings(), calls CephWrapper() where HTTPS certificate checks are disabled then asserts disable_warnings() was not called)
To confirm urllib3. disable_ warnins is not called without relying on log messages:
python <<EOF packages. urllib3
func= requests. packages. urllib3. disable_ warnings) : func()) packages. urllib3. disable_ warnings= override ).osd_df( ) requests. packages. urllib3. disable_ warnings( query=True) == 0)
import requests.
from cephclient.wrapper import CephWrapper
def override(calls=[], query=False,
if query:
return len(calls)
return calls.append(
requests.
CephWrapper(
assert(
EOF
should not print AssertionError.
(python mock is not available on controller; this snippet patches disable_warnings(), calls CephWrapper() where HTTPS certificate checks are disabled then asserts disable_warnings() was not called)