Skip to content

Commit

Permalink
test each download
Browse files Browse the repository at this point in the history
  • Loading branch information
mccalluc committed Nov 22, 2024
1 parent 81dcce5 commit a173589
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit a173589

Please sign in to comment.