import re
-def mock_http_response(mocker, method='GET', site='https://vrops', url_pattern='', response_file='OK',
- status_code=200, exception=None):
- '''Helper function to load a canned response from a file.'''
- with open(os.path.join(os.path.dirname(__file__), 'vmware_mocks',
- '%s' % response_file), 'r') as f:
+def mock_http_response(
+ mocker,
+ method="GET",
+ site="https://vrops",
+ url_pattern="",
+ response_file="OK",
+ status_code=200,
+ exception=None,
+):
+ """Helper function to load a canned response from a file."""
+ with open(
+ os.path.join(os.path.dirname(__file__), "vmware_mocks", "%s" % response_file),
+ "r",
+ ) as f:
response = f.read()
matcher = re.compile(site + url_pattern)