class_docstr: Test /component endpoint.
class_docstr_tok: ["Test","\/component","endpoint","."]
docstr: Tests to ensure a path based on the same prefix but a different
  directory test folder is forbidden.
docstr_tok: ["Tests","to","ensure","a","path","based","on","the","same","prefix","but","a","different","directory","test","folder","is","forbidden","."]
code: def test_outside_component_dir_with_same_prefix_request(self):
      """Tests to ensure a path based on the same prefix but a different
      directory test folder is forbidden."""
  
      with mock.patch(
          "streamlit.components.v1.components.os.path.isdir"
      ):
          # We don't need the return value in this case.
          declare_component("test", path=PATH)
  
      response = self._request_component(
          f"tests.streamlit.web.server.component_request_handler_test.test//{PATH}_really"
      )
  
      self.assertEqual(403, response.code)
      self.assertEqual(b"forbidden", response.body)
  
file_path: streamlit/lib/tests/streamlit/web/server/component_request_handler_test.py
imports: from unittest import mock
  import tornado.testing
  import tornado.web
  from streamlit.components.v1.components import ComponentRegistry, declare_component
  from streamlit.web.server import ComponentRequestHandler
label_desc: Use image node_id 6 for calling the ComponentRequestHandlerTest obj's underlying member method code with example usage: obj.test_outside_component_dir_with_same_prefix_request() without return types