def test_add_input_files_append(context_with_data: CodeExecutorContext):
  """Test appending to existing input files."""
  new_file = File(name="input2.log", content="Yw==", mime_type="text/x-log")
  context_with_data.add_input_files([new_file])
  expected_files_data = [
      {"name": "input1.txt", "content": "YQ==", "mime_type": "text/plain"},
      {"name": "input2.log", "content": "Yw==", "mime_type": "text/x-log"},
  ]
  assert (
      context_with_data._session_state["_code_executor_input_files"]
      == expected_files_data
  )
Test appending to existing input files.
tests/unittests/code_executors/test_code_executor_context.py