gradio/test
Shubham raj 1c257f5ebc
Bugfix: .. in filename throwing error while loading in output. (#7795)
* Exclude filename while preventing path traversal

* add changeset

* add changeset

* Check if path1 is a file and use path1
parent to compare

* explicit

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-03-25 19:27:42 +00:00
..
golden
test_files
tmp
__init__.py
conftest.py
README.md
requirements.in
requirements.txt downgrade contourpy (#7650) 2024-03-08 16:11:43 -08:00
test_analytics.py
test_api_info.py
test_blocks.py Remove Ruff and Uvicorn in Wasm env (#7744) 2024-03-22 17:32:59 +09:00
test_buttons.py
test_chat_interface.py Fix accidental bug that prevented custom textboxes from being passed to chatinterface (#7783) 2024-03-21 19:22:14 +00:00
test_components.py Add format parameter to gr.Image, gr.Gallery, gr.AnnotatedImage, gr.Plot to control format to save image files in (#7680) 2024-03-19 19:29:27 +00:00
test_custom_component_compatibility.py
test_events.py
test_external.py Adds support for kwargs and default arguments in the python client, and improves how parameter information is displayed in the "view API" page (#7732) 2024-03-21 17:18:13 -07:00
test_flagging.py Fix flagged files and ensure that flagging_mode="auto" saves output components as well (#7704) 2024-03-14 14:03:34 -07:00
test_gradio_component_cli.py Add --python-path, --pip-path, --gradio-path CLI arguments to let custom component developers control which executable is used (#7638) 2024-03-08 15:01:49 -08:00
test_helpers.py
test_http_server.py Remove Ruff and Uvicorn in Wasm env (#7744) 2024-03-22 17:32:59 +09:00
test_interfaces.py Adds trigger_mode to gr.on. Use it to set trigger_model="always_last" for live interfaces. (#7794) 2024-03-22 16:00:52 -07:00
test_networking.py Remove Ruff and Uvicorn in Wasm env (#7744) 2024-03-22 17:32:59 +09:00
test_pipelines.py
test_processing_utils.py
test_queueing.py
test_reload.py Remove Ruff and Uvicorn in Wasm env (#7744) 2024-03-22 17:32:59 +09:00
test_routes.py Fix root url resolution from x_forwarded_host headers (#7787) 2024-03-22 15:08:40 -07:00
test_theme_sharing.py
test_tunneling.py
test_utils.py Bugfix: .. in filename throwing error while loading in output. (#7795) 2024-03-25 19:27:42 +00:00

Backend Testing Guidelines

  • All the tests should test Backend functionalities. Frontend functionalities and e2e tests are done in Frontend.
  • Make use of pytest fixtures whenever it is possible. With fixtures, objects with high initialize durations are reused within tests, ex. a client session.
  • All testdata resides within _gradio/test_data and all test_files reside within test/test_files.
  • When doing network operations do not forget to make use of async to make tests faster.
  • Have clear class and function naming within the tests.
  • Short descriptions within test functions are great.
  • Library function docstrings is expected to contain an example, please add missing docstrings to the library while you are writing tests the related function.
  • Library docstring examples and descriptions are expected to align with tests, please fix divergent tests and library docstrings.