code: def test_secrets():
      def script():
          import streamlit as st
  
          st.write(st.secrets["foo"])
  
      at = AppTest.from_function(script)
      at.secrets["foo"] = "bar"
      at.run()
      assert at.markdown[0].value == "bar"
      assert at.secrets["foo"] == "bar"
  
file_path: streamlit/lib/tests/streamlit/testing/app_test_test.py
imports: import pytest
  from streamlit.testing.v1 import AppTest
label_desc: Use image node_id 5 for calling a global function with example usage: test_secrets() without return types