From a173589d7a5c9356fb16762406bf62daf065f759 Mon Sep 17 00:00:00 2001 From: Chuck McCallum Date: Fri, 22 Nov 2024 00:39:59 -0500 Subject: [PATCH] test each download --- tests/test_app.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tests/test_app.py b/tests/test_app.py index df9e0c9..93c0ed6 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -117,14 +117,33 @@ def expect_no_error(): expect_visible(download_results_text) expect_no_error() - with page.expect_download() as download_info: + # Notebook: + with page.expect_download() as report_download_info: + page.get_by_text("Download report").click() + expect_no_error() + + report_download = report_download_info.value + report = report_download.path().read_text() + assert "inputs:" in report + + # Script: + with page.expect_download() as script_download_info: page.get_by_text("Download script").click() expect_no_error() - download = download_info.value - script = download.path().read_text() + script_download = script_download_info.value + script = script_download.path().read_text() assert "privacy_unit = dp.unit_of(contributions=42)" in script + # Notebook: + with page.expect_download() as notebook_download_info: + page.get_by_text("Download notebook").click() + expect_no_error() + + notebook_download = notebook_download_info.value + notebook = notebook_download.path().read_text() + assert "privacy_unit = dp.unit_of(contributions=42)" in notebook + # -- Feedback -- page.get_by_text("Feedback").click() iframe = page.locator("#feedback-iframe")