MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / requests_get

Method requests_get

unit-tests/test_command_record.py:576–586  ·  view source on GitHub ↗
(url, **kwargs)

Source from the content-addressed store, hash-verified

574 return (x[0] for x in attachments.values())
575
576 def requests_get(url, **kwargs):
577 body = next((x[1] for x in attachments.values() if x[0].url == url), None)
578 if not body:
579 raise Exception(f'URL \"{url}\" not found.')
580 rs = mock.Mock()
581 rs.status_code = 200
582 stream = io.BytesIO(body)
583 rs.raw = stream
584 rs.__enter__ = mock.Mock(return_value=rs)
585 rs.__exit__ = mock.Mock(return_value=None)
586 return rs
587
588 with mock.patch('keepercommander.attachment.prepare_attachment_download', side_effect=prepare_download), \
589 mock.patch('requests.get', side_effect=requests_get), \

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected