gradio/test
Yuichiro Tachibana (Tsuchiya) b25e95e164
Fix processing_utils.save_url_to_cache() to follow redirects when accessing the URL (#7322)
* Fix `processing_utils.save_url_to_cache()` to follow redirects when accessing the URL

* add changeset

* follow more redirects

* format

* add changeset

* add test

* validate urls

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-02-06 19:46:20 +00:00
..
golden updated test images 2022-03-17 10:45:48 -07:00
test_files Rotate Images to Upright Position in preprocess (#6676) 2023-12-07 13:16:48 -05:00
tmp End-to-end UI tests with Selenium (#72) 2020-10-23 18:28:30 +04:00
__init__.py blocks-components-tests 2022-03-30 13:08:34 +03:00
conftest.py Version 4 development branch (#5498) 2023-10-31 04:46:02 +00:00
README.md fixed typo (#6896) 2023-12-29 08:17:57 -08:00
requirements.in Update ruff to 0.1.13, enable more rules, fix issues (#7061) 2024-02-01 11:32:40 -08:00
requirements.txt Update ruff to 0.1.13, enable more rules, fix issues (#7061) 2024-02-01 11:32:40 -08:00
test_analytics.py Update ruff to 0.1.13, enable more rules, fix issues (#7061) 2024-02-01 11:32:40 -08:00
test_api_info.py Add show_api parameter to events, and fix gr.load(). Also makes some minor improvements to the "view API" page when running on Spaces (#6846) 2023-12-22 11:59:02 -08:00
test_blocks.py Update ruff to 0.1.13, enable more rules, fix issues (#7061) 2024-02-01 11:32:40 -08:00
test_buttons.py Cause gr.ClearButton to reset the value of gr.State (#6680) 2023-12-06 17:35:19 -08:00
test_chat_interface.py Fixes issue 5781: Enables specifying a caching directory for Examples (#6803) 2023-12-18 17:07:38 -08:00
test_components.py Fixes issue with datatype setting in gr.Dataframe. Setting no longer dependent on col_count (#7286) 2024-02-02 09:34:16 -08:00
test_custom_component_compatibility.py Update ruff to 0.1.13, enable more rules, fix issues (#7061) 2024-02-01 11:32:40 -08:00
test_events.py Add concurrency_limit to ChatInterface, add IDE support for concurrency_limit (#6653) 2023-12-04 17:19:53 -05:00
test_external.py Fixes issue 5781: Enables specifying a caching directory for Examples (#6803) 2023-12-18 17:07:38 -08:00
test_flagging.py fix: avoid unnecessary folders creation when flagging (#6245) 2023-11-02 12:28:38 -07:00
test_gradio_component_cli.py Update ruff to 0.1.13, enable more rules, fix issues (#7061) 2024-02-01 11:32:40 -08:00
test_helpers.py Refactor examples so they accept data in the same format as is returned by function, rename .as_example() to .process_example() (#6933) 2024-01-10 16:35:25 -08:00
test_interfaces.py Update ruff to 0.1.13, enable more rules, fix issues (#7061) 2024-02-01 11:32:40 -08:00
test_networking.py Version 4 development branch (#5498) 2023-10-31 04:46:02 +00:00
test_pipelines.py Version 4 development branch (#5498) 2023-10-31 04:46:02 +00:00
test_processing_utils.py Fix processing_utils.save_url_to_cache() to follow redirects when accessing the URL (#7322) 2024-02-06 19:46:20 +00:00
test_queueing.py Python client properly handles hearbeat and log messages. Also handles responses longer than 65k (#6693) 2023-12-13 17:47:06 -05:00
test_reload.py Fix SourceFileReloader to watch the module with a qualified name to avoid importing a module with the same name from a different path (#6497) 2023-11-20 13:54:26 -05:00
test_routes.py Update ruff to 0.1.13, enable more rules, fix issues (#7061) 2024-02-01 11:32:40 -08:00
test_theme_sharing.py Hotfix: update huggingface_hub dependency version (#6704) 2023-12-07 15:07:23 -08:00
test_tunneling.py Version 4 development branch (#5498) 2023-10-31 04:46:02 +00:00
test_utils.py Fix processing_utils.save_url_to_cache() to follow redirects when accessing the URL (#7322) 2024-02-06 19:46:20 +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.