MCPcopy
hub / github.com/reflex-dev/reflex / test_generate_component

Function test_generate_component

tests/units/test_app.py:3072–3088  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3070
3071
3072def test_generate_component():
3073 def index():
3074 return rx.box("Index")
3075
3076 def index_mismatch():
3077 return rx.match(
3078 1,
3079 (1, rx.box("Index")),
3080 (2, "About"),
3081 "Bar",
3082 )
3083
3084 comp = App._generate_component(index)
3085 assert isinstance(comp, Component)
3086
3087 with pytest.raises(exceptions.MatchTypeError):
3088 App._generate_component(index_mismatch)
3089
3090
3091def test_add_page_component_returning_tuple():

Callers

nothing calls this directly

Calls 1

_generate_componentMethod · 0.80

Tested by

no test coverage detected