class_docstr: Tests for st.secrets with multiple secrets.toml files.
class_docstr_tok: ["Tests","for","st.secrets","with","multiple","secrets.toml","files","."]
docstr: Test that if both global and project-level secrets.toml files exist, secrets
  from both are present in st.secrets, and secrets from the project-level file
  "win" when secrets have conflicting names.
docstr_tok: ["Test","that","if","both","global","and","project-level","secrets.toml","files","exist",",","secrets","from","both","are","present","in","st.secrets",",","and","secrets","from","the","project-level","file","''","win","''","when","secrets","have","conflicting","names","."]
code: def test_secret_overwriting(self, patched_logger):
      """Test that if both global and project-level secrets.toml files exist, secrets
      from both are present in st.secrets, and secrets from the project-level file
      "win" when secrets have conflicting names.
      """
      with os.fdopen(self._fd1, "w") as tmp:
          tmp.write(MOCK_TOML)
  
      with os.fdopen(self._fd2, "w") as tmp:
          tmp.write(
              """
  db_password="54321dvorak"
  hi="I'm new"
  
  [subsection]
  email2="eng2@streamlit.io"
  """
          )
  
      secrets_file_locations = [
          self._path1,
          self._path2,
      ]
      secrets = Secrets(secrets_file_locations)
  
      # secrets.db_username is only defined in the first secrets.toml file, so it
      # remains unchanged.
      self.assertEqual(secrets.db_username, "Jane")
  
      # secrets.db_password should be overwritten because it's set to a different
      # value in our second secrets.toml file.
      self.assertEqual(secrets.db_password, "54321dvorak")
  
      # secrets.hi only appears in our second secrets.toml file.
      self.assertEqual(secrets.hi, "I'm new")
  
      # Secrets subsections are overwritten entirely rather than being merged.
      self.assertEqual(
          secrets.subsection, {"email2": "eng2@streamlit.io"}
      )
  
      patched_logger.info.assert_called_once_with(
          f"Secrets found in multiple locations: {self._path1}, {self._path2}. "
          "When multiple secret.toml files exist, local secrets will take precedence over global secrets."
      )
  
imports: import os
  import tempfile
  import unittest
  from collections.abc import Mapping
  from collections.abc import MutableMapping
  from typing import Mapping, MutableMapping
  from unittest.mock import MagicMock, mock_open, patch
  from parameterized import parameterized
  from toml import TomlDecodeError
  from streamlit.runtime.secrets import SECRETS_FILE_LOCS, AttrDict, Secrets
  from tests.exception_capturing_thread import call_on_threads
label_desc: Use image node_id 5 for calling the MultipleSecretsFilesTest obj's underlying member method code with example usage: obj.test_secret_overwriting(patched_logger) without return types