Skip to content

Commit

Permalink
fix test for toasts
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwoer committed Oct 31, 2024
1 parent b0afa49 commit e2803df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion alphastats/gui/pages/03_Preprocessing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import streamlit as st
from DataSet_Preprocess import PreprocessingStateKeys

from alphastats.DataSet_Preprocess import PreprocessingStateKeys
from alphastats.gui.utils.preprocessing_helper import (
configure_preprocessing,
display_preprocessing_info,
Expand Down
9 changes: 5 additions & 4 deletions tests/llm/test_llm_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ def mock_streamlit():
with patch("streamlit.info") as mock_info, patch(
"streamlit.error"
) as mock_error, patch("streamlit.success") as mock_success, patch(
"streamlit.session_state", {}
) as mock_session_state:
"streamlit.toast"
) as mock_toast, patch("streamlit.session_state", {}) as mock_session_state:
yield {
"info": mock_info,
"error": mock_error,
"success": mock_success,
"toast": mock_toast,
"session_state": mock_session_state,
}

Expand Down Expand Up @@ -92,8 +93,8 @@ def test_set_api_key_from_secrets(mock_exists, mock_st_secrets, mock_streamlit):

set_api_key()

mock_streamlit["info"].assert_called_with(
"OpenAI API key loaded from secrets.toml."
mock_streamlit["toast"].assert_called_with(
"OpenAI API key loaded from secrets.toml.", icon="✅"
)
assert (
mock_streamlit["session_state"][StateKeys.OPENAI_API_KEY]
Expand Down

0 comments on commit e2803df

Please sign in to comment.