From 8977ab7918028a06ed937ed622f96c4aedc4a041 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 4 Nov 2024 10:30:20 -0800 Subject: [PATCH] assert .name in other tests as well --- tests/integration/test_upload.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_upload.py b/tests/integration/test_upload.py index 2f6151cc5..ade72bf51 100644 --- a/tests/integration/test_upload.py +++ b/tests/integration/test_upload.py @@ -206,7 +206,8 @@ async def test_upload_file( file_data = await AppHarness._poll_for_async(get_file_data) assert isinstance(file_data, dict) - assert file_data[exp_name] == exp_contents + normalized_file_data = {Path(k).name: v for k, v in file_data.items()} + assert normalized_file_data[exp_name] == exp_contents # check that the selected files are displayed selected_files = driver.find_element(By.ID, f"selected_files{suffix}") @@ -257,7 +258,9 @@ async def test_upload_file_multiple(tmp_path, upload_file: AppHarness, driver): # check that the selected files are displayed selected_files = driver.find_element(By.ID, "selected_files") - assert selected_files.text == "\n".join(exp_files) + assert [Path(name).name for name in selected_files.text.split("\n")] == [ + Path(name).name for name in exp_files + ] # do the upload upload_button.click()