From 8f31bca1403f5e80a8ebf53bb2797cff27eeedb3 Mon Sep 17 00:00:00 2001 From: Julia Schessner Date: Thu, 12 Sep 2024 16:14:48 +0200 Subject: [PATCH 01/10] Add test for overview with data (supposed to fail at the moment) --- tests/gui/test_03_data_overview.py | 12 ++++++++++++ tests/gui/test_04_preprocessing.py | 21 +-------------------- tests/gui/test_helper.py | 27 +++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 tests/gui/test_helper.py diff --git a/tests/gui/test_03_data_overview.py b/tests/gui/test_03_data_overview.py index b3b003a7..ccae8502 100644 --- a/tests/gui/test_03_data_overview.py +++ b/tests/gui/test_03_data_overview.py @@ -1,6 +1,7 @@ from streamlit.testing.v1 import AppTest from pathlib import Path from unittest.mock import MagicMock, patch +from .test_helper import create_dataset_alphapept import pandas as pd from io import BytesIO @@ -23,3 +24,14 @@ def test_page_03_loads_without_input(): at.run() assert not at.exception + + +def test_page_03_loads_with_input(): + """Test if the page loads with input and inititalizes the session state with the correct values.""" + at = AppTest(APP_FILE, default_timeout=200) + at.run() + + at.session_state["dataset"] = create_dataset_alphapept() + at.run() + + assert not at.exception \ No newline at end of file diff --git a/tests/gui/test_04_preprocessing.py b/tests/gui/test_04_preprocessing.py index 7c0e6f1d..cbe7965f 100644 --- a/tests/gui/test_04_preprocessing.py +++ b/tests/gui/test_04_preprocessing.py @@ -1,8 +1,8 @@ from alphastats import DataSet -from alphastats.load_data import load_data from streamlit.testing.v1 import AppTest from pathlib import Path from unittest.mock import MagicMock, patch +from .test_helper import create_dataset_alphapept import pandas as pd from io import BytesIO @@ -12,25 +12,6 @@ TEST_INPUT_FILES = f"{APP_FOLDER}/../../testfiles" -def print_session_state(apptest: AppTest): - for k, v in apptest.session_state.filtered_state.items(): - print( - f"{k}: {str(type(v))} {str(v)[:20] if type(v) not in [int, list, str] else v}" - ) - - -def create_dataset_alphapept(): - loader = load_data( - file=TEST_INPUT_FILES + "/alphapept/results_proteins.csv", type="alphapept" - ) - metadata_path = TEST_INPUT_FILES + "/alphapept/metadata.csv" - return DataSet( - loader=loader, - metadata_path=metadata_path, - sample_column="sample", - ) - - def test_page_04_loads_without_input(): """Test if the page loads without any input and inititalizes the session state with the correct values.""" at = AppTest(APP_FILE, default_timeout=200) diff --git a/tests/gui/test_helper.py b/tests/gui/test_helper.py new file mode 100644 index 00000000..14a6264f --- /dev/null +++ b/tests/gui/test_helper.py @@ -0,0 +1,27 @@ + +from streamlit.testing.v1 import AppTest +from alphastats.load_data import load_data +from pathlib import Path +from alphastats import DataSet + + +APP_FOLDER = Path(__file__).parent / Path("../../alphastats/gui/") +TEST_INPUT_FILES = f"{APP_FOLDER}/../../testfiles" + +def print_session_state(apptest: AppTest): + for k, v in apptest.session_state.filtered_state.items(): + print( + f"{k}: {str(type(v))} {str(v)[:20] if type(v) not in [int, list, str] else v}" + ) + + +def create_dataset_alphapept(): + loader = load_data( + file = TEST_INPUT_FILES + "/alphapept/results_proteins.csv", type="alphapept" + ) + metadata_path = TEST_INPUT_FILES + "/alphapept/metadata.csv" + return DataSet( + loader=loader, + metadata_path=metadata_path, + sample_column="sample", + ) \ No newline at end of file From 4ec15dd2b923d9190227252ade77a4f927382dcc Mon Sep 17 00:00:00 2001 From: Julia Schessner Date: Thu, 12 Sep 2024 16:24:13 +0200 Subject: [PATCH 02/10] Remove session state as argument here --- alphastats/gui/utils/overview_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alphastats/gui/utils/overview_helper.py b/alphastats/gui/utils/overview_helper.py index c5678cb9..dc7a91d2 100644 --- a/alphastats/gui/utils/overview_helper.py +++ b/alphastats/gui/utils/overview_helper.py @@ -43,8 +43,8 @@ def display_matrix(): st.markdown("**DataFrame used for analysis** *preview*") st.markdown(text) - df = get_display_matrix(st.session_state.user_session_id) - csv = convert_df(st.session_state.dataset.mat, st.session_state.user_session_id) + df = get_display_matrix() + csv = convert_df(st.session_state.dataset.mat) st.dataframe(df) From a73f7f3b84b980d77770553f1456c2e3d031816f Mon Sep 17 00:00:00 2001 From: Julia Schessner Date: Thu, 12 Sep 2024 17:17:55 +0200 Subject: [PATCH 03/10] rename conftest --- tests/gui/conftest.py | 27 +++++++++++++++++++++++++++ tests/gui/test_03_data_overview.py | 4 ++-- tests/gui/test_04_preprocessing.py | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 tests/gui/conftest.py diff --git a/tests/gui/conftest.py b/tests/gui/conftest.py new file mode 100644 index 00000000..9a33be2c --- /dev/null +++ b/tests/gui/conftest.py @@ -0,0 +1,27 @@ +from streamlit.testing.v1 import AppTest +from alphastats.load_data import load_data +from pathlib import Path +from alphastats import DataSet + + +APP_FOLDER = Path(__file__).parent / Path("../../alphastats/gui/") +TEST_INPUT_FILES = f"{APP_FOLDER}/../../testfiles" + + +def print_session_state(apptest: AppTest): + for k, v in apptest.session_state.filtered_state.items(): + print( + f"{k}: {str(type(v))} {str(v)[:20] if type(v) not in [int, list, str] else v}" + ) + + +def create_dataset_alphapept(): + loader = load_data( + file=TEST_INPUT_FILES + "/alphapept/results_proteins.csv", type="alphapept" + ) + metadata_path = TEST_INPUT_FILES + "/alphapept/metadata.csv" + return DataSet( + loader=loader, + metadata_path=metadata_path, + sample_column="sample", + ) diff --git a/tests/gui/test_03_data_overview.py b/tests/gui/test_03_data_overview.py index ccae8502..e3c1b7e8 100644 --- a/tests/gui/test_03_data_overview.py +++ b/tests/gui/test_03_data_overview.py @@ -1,7 +1,7 @@ from streamlit.testing.v1 import AppTest from pathlib import Path from unittest.mock import MagicMock, patch -from .test_helper import create_dataset_alphapept +from .conftest import create_dataset_alphapept import pandas as pd from io import BytesIO @@ -34,4 +34,4 @@ def test_page_03_loads_with_input(): at.session_state["dataset"] = create_dataset_alphapept() at.run() - assert not at.exception \ No newline at end of file + assert not at.exception diff --git a/tests/gui/test_04_preprocessing.py b/tests/gui/test_04_preprocessing.py index cbe7965f..28725349 100644 --- a/tests/gui/test_04_preprocessing.py +++ b/tests/gui/test_04_preprocessing.py @@ -2,7 +2,7 @@ from streamlit.testing.v1 import AppTest from pathlib import Path from unittest.mock import MagicMock, patch -from .test_helper import create_dataset_alphapept +from .conftest import create_dataset_alphapept import pandas as pd from io import BytesIO From 1ce6019a6db55d3c2f329cf8a3e642086a175aed Mon Sep 17 00:00:00 2001 From: Julia Schessner Date: Thu, 12 Sep 2024 17:18:11 +0200 Subject: [PATCH 04/10] remove test helper --- tests/gui/test_helper.py | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 tests/gui/test_helper.py diff --git a/tests/gui/test_helper.py b/tests/gui/test_helper.py deleted file mode 100644 index 14a6264f..00000000 --- a/tests/gui/test_helper.py +++ /dev/null @@ -1,27 +0,0 @@ - -from streamlit.testing.v1 import AppTest -from alphastats.load_data import load_data -from pathlib import Path -from alphastats import DataSet - - -APP_FOLDER = Path(__file__).parent / Path("../../alphastats/gui/") -TEST_INPUT_FILES = f"{APP_FOLDER}/../../testfiles" - -def print_session_state(apptest: AppTest): - for k, v in apptest.session_state.filtered_state.items(): - print( - f"{k}: {str(type(v))} {str(v)[:20] if type(v) not in [int, list, str] else v}" - ) - - -def create_dataset_alphapept(): - loader = load_data( - file = TEST_INPUT_FILES + "/alphapept/results_proteins.csv", type="alphapept" - ) - metadata_path = TEST_INPUT_FILES + "/alphapept/metadata.csv" - return DataSet( - loader=loader, - metadata_path=metadata_path, - sample_column="sample", - ) \ No newline at end of file From 3ebf0abdb02b610f0cc8c01eaf6167d9a5242ead Mon Sep 17 00:00:00 2001 From: Julia Schessner Date: Fri, 13 Sep 2024 11:12:30 +0200 Subject: [PATCH 05/10] Fix imports --- tests/gui/conftest.py | 3 +++ tests/gui/test_03_data_overview.py | 15 +-------------- tests/gui/test_04_preprocessing.py | 9 ++------- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/tests/gui/conftest.py b/tests/gui/conftest.py index 9a33be2c..82decee9 100644 --- a/tests/gui/conftest.py +++ b/tests/gui/conftest.py @@ -9,6 +9,8 @@ def print_session_state(apptest: AppTest): + """Prints the session state of the AppTest object. + Not used productively, but for debugging purposes.""" for k, v in apptest.session_state.filtered_state.items(): print( f"{k}: {str(type(v))} {str(v)[:20] if type(v) not in [int, list, str] else v}" @@ -16,6 +18,7 @@ def print_session_state(apptest: AppTest): def create_dataset_alphapept(): + """Creates a dataset object from the alphapept testfiles.""" loader = load_data( file=TEST_INPUT_FILES + "/alphapept/results_proteins.csv", type="alphapept" ) diff --git a/tests/gui/test_03_data_overview.py b/tests/gui/test_03_data_overview.py index e3c1b7e8..0a6caa52 100644 --- a/tests/gui/test_03_data_overview.py +++ b/tests/gui/test_03_data_overview.py @@ -1,22 +1,9 @@ from streamlit.testing.v1 import AppTest from pathlib import Path from unittest.mock import MagicMock, patch -from .conftest import create_dataset_alphapept -import pandas as pd -from io import BytesIO +from .conftest import create_dataset_alphapept, APP_FOLDER - -def print_session_state(apptest: AppTest): - for k, v in apptest.session_state.filtered_state.items(): - print( - f"{k}: {str(type(v))} {str(v)[:20] if type(v) not in [int, list, str] else v}" - ) - - -APP_FOLDER = Path(__file__).parent / Path("../../alphastats/gui/") APP_FILE = f"{APP_FOLDER}/pages/03_Data Overview.py" -TEST_INPUT_FILES = f"{APP_FOLDER}/../../testfiles" - def test_page_03_loads_without_input(): """Test if the page loads without any input and inititalizes the session state with the correct values.""" diff --git a/tests/gui/test_04_preprocessing.py b/tests/gui/test_04_preprocessing.py index 28725349..6a2bf9b3 100644 --- a/tests/gui/test_04_preprocessing.py +++ b/tests/gui/test_04_preprocessing.py @@ -1,15 +1,10 @@ -from alphastats import DataSet from streamlit.testing.v1 import AppTest from pathlib import Path from unittest.mock import MagicMock, patch -from .conftest import create_dataset_alphapept -import pandas as pd -from io import BytesIO +from .conftest import create_dataset_alphapept, APP_FOLDER -APP_FOLDER = Path(__file__).parent / Path("../../alphastats/gui/") APP_FILE = f"{APP_FOLDER}/pages/03_Preprocessing.py" -TEST_INPUT_FILES = f"{APP_FOLDER}/../../testfiles" def test_page_04_loads_without_input(): @@ -21,7 +16,7 @@ def test_page_04_loads_without_input(): def test_page_04_loads_with_input(): - """Test if the page loads with input and inititalizes the session state with the correct values.""" + """Test if the page loads with input and serves the processing interface correctly.""" at = AppTest(APP_FILE, default_timeout=200) at.run() From 7061027e5058b613caff135b7f85811242720357 Mon Sep 17 00:00:00 2001 From: Julia Schessner Date: Fri, 13 Sep 2024 11:13:11 +0200 Subject: [PATCH 06/10] format --- tests/gui/test_03_data_overview.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/gui/test_03_data_overview.py b/tests/gui/test_03_data_overview.py index 0a6caa52..5816da84 100644 --- a/tests/gui/test_03_data_overview.py +++ b/tests/gui/test_03_data_overview.py @@ -5,6 +5,7 @@ APP_FILE = f"{APP_FOLDER}/pages/03_Data Overview.py" + def test_page_03_loads_without_input(): """Test if the page loads without any input and inititalizes the session state with the correct values.""" at = AppTest(APP_FILE, default_timeout=200) From 3750213832e943b8b18a6c765065f557df17dfc5 Mon Sep 17 00:00:00 2001 From: Julia Schessner Date: Fri, 13 Sep 2024 11:41:50 +0200 Subject: [PATCH 07/10] Unify use of conftest, constant names --- alphastats/load_data.py | 1 + tests/gui/conftest.py | 32 +++++++++++++++++++---- tests/gui/test_02_import_data.py | 41 +++++------------------------- tests/gui/test_03_data_overview.py | 6 ++--- tests/gui/test_04_preprocessing.py | 8 +++--- 5 files changed, 41 insertions(+), 47 deletions(-) diff --git a/alphastats/load_data.py b/alphastats/load_data.py index 03473370..19d9dee3 100644 --- a/alphastats/load_data.py +++ b/alphastats/load_data.py @@ -4,6 +4,7 @@ from alphastats.loader.MaxQuantLoader import * +# TODO: Currenlty only used by tests, but should maybe be used more widely def load_data(file, type, **kwargs): type = type.lower() if type == "maxquant": diff --git a/tests/gui/conftest.py b/tests/gui/conftest.py index 82decee9..235fe689 100644 --- a/tests/gui/conftest.py +++ b/tests/gui/conftest.py @@ -2,10 +2,11 @@ from alphastats.load_data import load_data from pathlib import Path from alphastats import DataSet +from io import BytesIO -APP_FOLDER = Path(__file__).parent / Path("../../alphastats/gui/") -TEST_INPUT_FILES = f"{APP_FOLDER}/../../testfiles" +APP_FOLDER = Path(__file__).parent / "../../alphastats/gui/" +TEST_INPUT_FILES_PATH = APP_FOLDER / "../../testfiles" def print_session_state(apptest: AppTest): @@ -20,11 +21,32 @@ def print_session_state(apptest: AppTest): def create_dataset_alphapept(): """Creates a dataset object from the alphapept testfiles.""" loader = load_data( - file=TEST_INPUT_FILES + "/alphapept/results_proteins.csv", type="alphapept" + file=str(TEST_INPUT_FILES_PATH / "alphapept/results_proteins.csv"), + type="alphapept", ) - metadata_path = TEST_INPUT_FILES + "/alphapept/metadata.csv" + metadata_path = TEST_INPUT_FILES_PATH / "alphapept/metadata.csv" return DataSet( loader=loader, - metadata_path=metadata_path, + metadata_path=str(metadata_path), sample_column="sample", ) + + +def data_buf(file_path: str): + """Helper function to open a data file from the testfiles folder and return a BytesIO object. + + Additionally add filename as attribute.""" + with open(TEST_INPUT_FILES_PATH / file_path, "rb") as f: + buf = BytesIO(f.read()) + buf.name = file_path.split("/")[-1] + return buf + + +def metadata_buf(file_path: str): + """Helper function to open a metadata file from the testfiles folder and return a BytesIO object. + + Additionally add filename as attribute and set the metadatafile in the session state.""" + with open(TEST_INPUT_FILES_PATH / file_path, "rb") as f: + buf = BytesIO(f.read()) + buf.name = file_path.split("/")[-1] + return buf diff --git a/tests/gui/test_02_import_data.py b/tests/gui/test_02_import_data.py index a1f85cc4..fb52ee82 100644 --- a/tests/gui/test_02_import_data.py +++ b/tests/gui/test_02_import_data.py @@ -1,19 +1,10 @@ from streamlit.testing.v1 import AppTest from pathlib import Path from unittest.mock import MagicMock, patch -from io import BytesIO +from .conftest import APP_FOLDER, data_buf, metadata_buf -def print_session_state(apptest: AppTest): - for k, v in apptest.session_state.filtered_state.items(): - print( - f"{k}: {str(type(v))} {str(v)[:20] if type(v) not in [int, list, str] else v}" - ) - - -APP_FOLDER = Path(__file__).parent / Path("../../alphastats/gui/") TESTED_PAGE = f"{APP_FOLDER}/pages/02_Import Data.py" -TEST_INPUT_FILES_PATH = APP_FOLDER / "../../testfiles" def test_page_02_loads_without_input(): @@ -69,26 +60,6 @@ def test_page_02_loads_example_data(mock_page_link: MagicMock): assert "statistic_options" in at.session_state -def _data_buf(file_path: str): - """Helper function to open a data file from the testfiles folder and return a BytesIO object. - - Additionally add filename as attribute.""" - with open(TEST_INPUT_FILES_PATH / file_path, "rb") as f: - buf = BytesIO(f.read()) - buf.name = file_path.split("/")[-1] - return buf - - -def _metadata_buf(file_path: str, at: AppTest): - """Helper function to open a metadata file from the testfiles folder and return a BytesIO object. - - Additionally add filename as attribute and set the metadatafile in the session state.""" - with open(TEST_INPUT_FILES_PATH / file_path, "rb") as f: - buf = BytesIO(f.read()) - buf.name = file_path.split("/")[-1] - return buf - - @patch("streamlit.file_uploader") @patch( "streamlit.page_link" @@ -114,13 +85,13 @@ def test_page_02_loads_maxquant_testfiles( at.run() # User uploads the data file - mock_file_uploader.side_effect = [_data_buf(DATA_FILE), None] + mock_file_uploader.side_effect = [data_buf(DATA_FILE), None] at.run() # User uploads the metadata file mock_file_uploader.side_effect = [ - _data_buf(DATA_FILE), - _metadata_buf(METADATA_FILE, at), + data_buf(DATA_FILE), + metadata_buf(METADATA_FILE), ] at.run() @@ -128,8 +99,8 @@ def test_page_02_loads_maxquant_testfiles( # User clicks the Load Data button mock_file_uploader.side_effect = [ - _data_buf(DATA_FILE), - _metadata_buf(METADATA_FILE, at), + data_buf(DATA_FILE), + metadata_buf(METADATA_FILE), ] at.button(key="_create_dataset").click() at.run() diff --git a/tests/gui/test_03_data_overview.py b/tests/gui/test_03_data_overview.py index 5816da84..109f4584 100644 --- a/tests/gui/test_03_data_overview.py +++ b/tests/gui/test_03_data_overview.py @@ -3,12 +3,12 @@ from unittest.mock import MagicMock, patch from .conftest import create_dataset_alphapept, APP_FOLDER -APP_FILE = f"{APP_FOLDER}/pages/03_Data Overview.py" +TESTED_PAGE = f"{APP_FOLDER}/pages/03_Data Overview.py" def test_page_03_loads_without_input(): """Test if the page loads without any input and inititalizes the session state with the correct values.""" - at = AppTest(APP_FILE, default_timeout=200) + at = AppTest(TESTED_PAGE, default_timeout=200) at.run() assert not at.exception @@ -16,7 +16,7 @@ def test_page_03_loads_without_input(): def test_page_03_loads_with_input(): """Test if the page loads with input and inititalizes the session state with the correct values.""" - at = AppTest(APP_FILE, default_timeout=200) + at = AppTest(TESTED_PAGE, default_timeout=200) at.run() at.session_state["dataset"] = create_dataset_alphapept() diff --git a/tests/gui/test_04_preprocessing.py b/tests/gui/test_04_preprocessing.py index 6a2bf9b3..bbe6a78b 100644 --- a/tests/gui/test_04_preprocessing.py +++ b/tests/gui/test_04_preprocessing.py @@ -4,12 +4,12 @@ from .conftest import create_dataset_alphapept, APP_FOLDER -APP_FILE = f"{APP_FOLDER}/pages/03_Preprocessing.py" +TESTED_PAGE = f"{APP_FOLDER}/pages/03_Preprocessing.py" def test_page_04_loads_without_input(): """Test if the page loads without any input and inititalizes the session state with the correct values.""" - at = AppTest(APP_FILE, default_timeout=200) + at = AppTest(TESTED_PAGE, default_timeout=200) at.run() assert not at.exception @@ -17,7 +17,7 @@ def test_page_04_loads_without_input(): def test_page_04_loads_with_input(): """Test if the page loads with input and serves the processing interface correctly.""" - at = AppTest(APP_FILE, default_timeout=200) + at = AppTest(TESTED_PAGE, default_timeout=200) at.run() at.session_state["dataset"] = create_dataset_alphapept() @@ -30,7 +30,7 @@ def test_page_04_loads_with_input(): def test_page_04_runs_preprocessreset_alphapept(): """Test if the page preprocesses and resets preprocessing without exceptions.""" - at = AppTest(APP_FILE, default_timeout=200) + at = AppTest(TESTED_PAGE, default_timeout=200) at.run() at.session_state["dataset"] = create_dataset_alphapept() From 6d693977a4984e9292b268f7c7901a604c4d5917 Mon Sep 17 00:00:00 2001 From: Julia Schessner Date: Fri, 13 Sep 2024 11:42:53 +0200 Subject: [PATCH 08/10] TODO fixtures --- tests/gui/conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/gui/conftest.py b/tests/gui/conftest.py index 235fe689..b4f953bd 100644 --- a/tests/gui/conftest.py +++ b/tests/gui/conftest.py @@ -4,6 +4,7 @@ from alphastats import DataSet from io import BytesIO +# TODO: Turn the helpers into fixtures APP_FOLDER = Path(__file__).parent / "../../alphastats/gui/" TEST_INPUT_FILES_PATH = APP_FOLDER / "../../testfiles" From 263d5d53a18a7110719f1a4da4e52a731b5e94f6 Mon Sep 17 00:00:00 2001 From: Julia Schessner Date: Fri, 13 Sep 2024 11:44:56 +0200 Subject: [PATCH 09/10] Use Path for tested page --- tests/gui/test_02_import_data.py | 2 +- tests/gui/test_03_data_overview.py | 2 +- tests/gui/test_04_preprocessing.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/gui/test_02_import_data.py b/tests/gui/test_02_import_data.py index fb52ee82..08d905b2 100644 --- a/tests/gui/test_02_import_data.py +++ b/tests/gui/test_02_import_data.py @@ -4,7 +4,7 @@ from .conftest import APP_FOLDER, data_buf, metadata_buf -TESTED_PAGE = f"{APP_FOLDER}/pages/02_Import Data.py" +TESTED_PAGE = APP_FOLDER / "pages/02_Import Data.py" def test_page_02_loads_without_input(): diff --git a/tests/gui/test_03_data_overview.py b/tests/gui/test_03_data_overview.py index 109f4584..95c12354 100644 --- a/tests/gui/test_03_data_overview.py +++ b/tests/gui/test_03_data_overview.py @@ -3,7 +3,7 @@ from unittest.mock import MagicMock, patch from .conftest import create_dataset_alphapept, APP_FOLDER -TESTED_PAGE = f"{APP_FOLDER}/pages/03_Data Overview.py" +TESTED_PAGE = APP_FOLDER / "pages/03_Data Overview.py" def test_page_03_loads_without_input(): diff --git a/tests/gui/test_04_preprocessing.py b/tests/gui/test_04_preprocessing.py index bbe6a78b..56b94229 100644 --- a/tests/gui/test_04_preprocessing.py +++ b/tests/gui/test_04_preprocessing.py @@ -4,7 +4,7 @@ from .conftest import create_dataset_alphapept, APP_FOLDER -TESTED_PAGE = f"{APP_FOLDER}/pages/03_Preprocessing.py" +TESTED_PAGE = APP_FOLDER / "pages/03_Preprocessing.py" def test_page_04_loads_without_input(): From cfad8df19993f84d50f2d1d757915ab55437cc2f Mon Sep 17 00:00:00 2001 From: Julia Schessner Date: Fri, 13 Sep 2024 12:41:19 +0200 Subject: [PATCH 10/10] undo last commit because the AppTest apparently needs a string --- tests/gui/test_02_import_data.py | 2 +- tests/gui/test_03_data_overview.py | 2 +- tests/gui/test_04_preprocessing.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/gui/test_02_import_data.py b/tests/gui/test_02_import_data.py index 08d905b2..fb52ee82 100644 --- a/tests/gui/test_02_import_data.py +++ b/tests/gui/test_02_import_data.py @@ -4,7 +4,7 @@ from .conftest import APP_FOLDER, data_buf, metadata_buf -TESTED_PAGE = APP_FOLDER / "pages/02_Import Data.py" +TESTED_PAGE = f"{APP_FOLDER}/pages/02_Import Data.py" def test_page_02_loads_without_input(): diff --git a/tests/gui/test_03_data_overview.py b/tests/gui/test_03_data_overview.py index 95c12354..109f4584 100644 --- a/tests/gui/test_03_data_overview.py +++ b/tests/gui/test_03_data_overview.py @@ -3,7 +3,7 @@ from unittest.mock import MagicMock, patch from .conftest import create_dataset_alphapept, APP_FOLDER -TESTED_PAGE = APP_FOLDER / "pages/03_Data Overview.py" +TESTED_PAGE = f"{APP_FOLDER}/pages/03_Data Overview.py" def test_page_03_loads_without_input(): diff --git a/tests/gui/test_04_preprocessing.py b/tests/gui/test_04_preprocessing.py index 56b94229..bbe6a78b 100644 --- a/tests/gui/test_04_preprocessing.py +++ b/tests/gui/test_04_preprocessing.py @@ -4,7 +4,7 @@ from .conftest import create_dataset_alphapept, APP_FOLDER -TESTED_PAGE = APP_FOLDER / "pages/03_Preprocessing.py" +TESTED_PAGE = f"{APP_FOLDER}/pages/03_Preprocessing.py" def test_page_04_loads_without_input():