Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
abidlabs committed Feb 28, 2025
1 parent ce9923e commit 02df14e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,13 @@ def mixed_components():
transpile(mixed_components, validate=True)

assert "Function must only return Gradio component updates" in str(e.value)


def test_gradio_component_with_none_values():
def component_with_none():
return gradio.Textbox(visible=True, info=None)

expected = """function component_with_none() {
return {"visible": true, "info": null, "__type__": "update"};
}"""
assert transpile(component_with_none).strip() == expected.strip()

0 comments on commit 02df14e

Please sign in to comment.