adf0d17497
publish / version_or_publish (push) Waiting to run
storybook-build / changes (push) Waiting to run
storybook-build / :storybook-build (push) Blocked by required conditions
Sync Gradio Skills to Hugging Face / sync-skills (push) Waiting to run
functional / changes (push) Waiting to run
functional / build-frontend (push) Blocked by required conditions
functional / functional-test-SSR=false (push) Blocked by required conditions
functional / functional-reload (push) Blocked by required conditions
functional / functional-test-SSR=true (push) Blocked by required conditions
hygiene / hygiene-test (push) Waiting to run
python / changes (push) Waiting to run
python / build (push) Blocked by required conditions
python / test-ubuntu-latest-flaky (push) Blocked by required conditions
python / test-ubuntu-latest-not-flaky (push) Blocked by required conditions
python / test-windows-latest-flaky (push) Blocked by required conditions
python / test-windows-latest-not-flaky (push) Blocked by required conditions
js / changes (push) Waiting to run
js / js-test (push) Blocked by required conditions
docs-build / changes (push) Waiting to run
docs-build / docs-build (push) Blocked by required conditions
docs-build / website-build (push) Blocked by required conditions
29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
import gradio as gr
|
|
|
|
|
|
class TestMarkdown:
|
|
def test_component_functions(self):
|
|
markdown_component = gr.Markdown("# Let's learn about $x$", label="Markdown")
|
|
assert markdown_component.get_config()["value"] == "# Let's learn about $x$"
|
|
assert not markdown_component.get_config()["buttons"]
|
|
|
|
def test_in_interface(self):
|
|
"""
|
|
Interface, process
|
|
"""
|
|
iface = gr.Interface(lambda x: x, "text", "markdown")
|
|
input_data = " Here's an [image](https://gradio.app/images/gradio_logo.png)"
|
|
output_data = iface(input_data)
|
|
assert output_data == input_data.strip()
|
|
|
|
def test_show_copy_button(self):
|
|
markdown_component = gr.Markdown("# Let's learn about $x$", buttons=["copy"])
|
|
assert markdown_component.get_config()["buttons"] == ["copy"]
|
|
|
|
def test_layout_parameters(self):
|
|
markdown_component = gr.Markdown(
|
|
"# Let's learn about $x$", scale=2, min_width=120
|
|
)
|
|
assert markdown_component.get_config()["scale"] == 2
|
|
assert markdown_component.get_config()["min_width"] == 120
|