Mercurial > silorider
view tests/mockutil.py @ 32:2265920c4688
Improve populate cache command
Make it use the same feed parsing code as the process command, and add
support for --dry-run argument.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 10 May 2023 16:06:46 -0700 |
parents | 27543b2e73b9 |
children | b404445082f8 |
line wrap: on
line source
def mock_urllib(m): import urllib.request m.setattr(urllib.request, 'urlretrieve', _patched_urlretrieve) m.setattr(urllib.request, 'urlcleanup', _patched_urlcleanup) return m def _patched_urlretrieve(url): return ('/retrieved/' + url.lstrip('/'), None) def _patched_urlcleanup(): pass