2
0
mirror of https://github.com/gradio-app/gradio.git synced 2024-12-09 02:00:44 +08:00
gradio/test/test_custom_component_compatibility.py
Abubakar Abid de998b2812
Processes avatar_images for gr.Chatbot and icon for gr.Button correctly, so that respective files are moved to cache ()
* format

* add changeset

* add changeset

* add changeset

* whoops fix

* notebook

* tests

* refactor

* refactor

* format

* added test

* fix test

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-11-11 23:13:27 -08:00

18 lines
534 B
Python

"""
This suite of tests is designed to ensure compatibility between the current version of Gradio
with custom components created using the previous version of Gradio.
"""
from pathlib import Path
from gradio_pdf import PDF
def test_processing_utils_backwards_compatibility():
pdf_component = PDF()
cached_pdf_file = pdf_component.as_example("test/test_files/sample_file.pdf")
assert (
cached_pdf_file
and Path(cached_pdf_file).exists()
and Path(cached_pdf_file).name == "sample_file.pdf"
)