(url, **kwargs)
| 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), \ |
nothing calls this directly
no outgoing calls
no test coverage detected