Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwoer committed Sep 10, 2024
1 parent 5bbb29e commit 93f2231
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/gui/test_02_import_data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import uuid

from streamlit.testing.v1 import AppTest
from pathlib import Path
from unittest.mock import MagicMock, patch
Expand All @@ -16,6 +18,14 @@ def print_session_state(apptest: AppTest):
TEST_INPUT_FILES = f"{APP_FOLDER}/../../testfiles"


def _is_valid_uuid(value: str) -> bool:
try:
uuid.UUID(str(value))
return True
except ValueError:
return False


def test_page_02_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)
Expand All @@ -24,7 +34,7 @@ def test_page_02_loads_without_input():
assert not at.exception

assert at.session_state.organism == 9606
assert at.session_state.user_session_id == "test session id"
assert at.session_state.user_session_id is not None
assert at.session_state.gene_to_prot_id == {}


Expand All @@ -37,7 +47,7 @@ def test_patched_page_02_loads_without_input(mock_file_uploader: MagicMock):
assert not at.exception

assert at.session_state.organism == 9606
assert at.session_state.user_session_id == "test session id"
assert at.session_state.user_session_id is not None
assert at.session_state.gene_to_prot_id == {}


Expand Down

0 comments on commit 93f2231

Please sign in to comment.