tests: fix test_adblock for new download manager

This commit is contained in:
Daniel Schadt 2016-07-07 13:30:38 +02:00
parent d42d980dda
commit 05c09a1476

View File

@ -92,12 +92,12 @@ class FakeDownloadManager:
"""Mock browser.downloads.DownloadManager."""
def get(self, url, fileobj, **kwargs):
def get(self, url, target, **kwargs):
"""Return a FakeDownloadItem instance with a fileobj.
The content is copied from the file the given url links to.
"""
download_item = FakeDownloadItem(fileobj, name=url.path())
download_item = FakeDownloadItem(target.fileobj, name=url.path())
with open(url.path(), 'rb') as fake_url_file:
shutil.copyfileobj(fake_url_file, download_item.fileobj)
return download_item