4cd2d4af2b
Test Browser Use CLI Install / uv pip install (ubuntu-latest) (push) Failing after 1s
Test Browser Use CLI Install / uvx browser-use from local wheel (push) Failing after 1s
Test Browser Use CLI Install / uvx browser-use[cli] from PyPI (push) Failing after 1s
package / pip-install-on-macos-latest-py-3.11 (push) Has been skipped
package / pip-install-on-macos-latest-py-3.13 (push) Has been skipped
package / pip-install-on-ubuntu-latest-py-3.11 (push) Has been skipped
package / pip-install-on-windows-latest-py-3.13 (push) Has been skipped
cloud_evals / trigger_cloud_eval_image_build (push) Failing after 1s
docker / build_publish_image (push) Failing after 1s
Test Browser Use CLI Install / browser-use skill sync (push) Failing after 1s
lint / code-style (push) Failing after 0s
lint / type-checker (push) Failing after 1s
package / pip-build (push) Failing after 1s
lint / syntax-errors (push) Failing after 3s
package / pip-install-on-ubuntu-latest-py-3.13 (push) Has been skipped
package / pip-install-on-windows-latest-py-3.11 (push) Has been skipped
test / ${{ matrix.test_filename }} (push) Has been skipped
test / evaluate-tasks (push) Has been skipped
test / setup-chromium (push) Failing after 2s
test / find_tests (push) Failing after 2s
Test Browser Use CLI Install / uv pip install (windows-latest) (push) Has been cancelled
Test Browser Use CLI Install / uv pip install (macos-latest) (push) Has been cancelled
52 lines
1.5 KiB
Python
52 lines
1.5 KiB
Python
from browser_use.browser.watchdogs.downloads_watchdog import _should_auto_download_network_response
|
|
|
|
|
|
def test_downloads_watchdog_skips_generic_text_attachment_without_file_url():
|
|
assert not _should_auto_download_network_response(
|
|
url='https://www.google.com/complete/search?q=test&client=gws-wiz&xssi=t',
|
|
content_type='text/plain',
|
|
is_pdf=False,
|
|
is_download_attachment=True,
|
|
suggested_filename='f.txt',
|
|
)
|
|
|
|
|
|
def test_downloads_watchdog_keeps_pdf_network_response():
|
|
assert _should_auto_download_network_response(
|
|
url='https://example.com/view?id=123',
|
|
content_type='application/pdf',
|
|
is_pdf=True,
|
|
is_download_attachment=False,
|
|
suggested_filename=None,
|
|
)
|
|
|
|
|
|
def test_downloads_watchdog_keeps_named_file_attachment():
|
|
assert _should_auto_download_network_response(
|
|
url='https://example.com/download?id=123',
|
|
content_type='text/csv',
|
|
is_pdf=False,
|
|
is_download_attachment=True,
|
|
suggested_filename='report.csv',
|
|
)
|
|
|
|
|
|
def test_downloads_watchdog_keeps_text_attachment_with_file_url():
|
|
assert _should_auto_download_network_response(
|
|
url='https://example.com/files/summary.txt?download=1',
|
|
content_type='text/plain',
|
|
is_pdf=False,
|
|
is_download_attachment=True,
|
|
suggested_filename='f.txt',
|
|
)
|
|
|
|
|
|
def test_downloads_watchdog_keeps_attachment_without_known_extension():
|
|
assert _should_auto_download_network_response(
|
|
url='https://example.com/download?id=123',
|
|
content_type='application/vnd.example.custom',
|
|
is_pdf=False,
|
|
is_download_attachment=True,
|
|
suggested_filename='statement',
|
|
)
|