def render(self): # import ipdb # ipdb.set_trace() return div({}, [ HelloWorldComponent({ "name": "Ustun", "surname": "Ozgur" }, []), HelloWorldComponent({ "name": "Reyhan", "surname": "Ustun" }, []) ])
def render(self): return div(["Hello", self.props.name, self.props['surname']])
def render(self): return div({}, [div({}, ["Hello World"]), div({}, ["Hello World"])])
def test_single_div_single_child(): assert render(div({}, ["foo"])) == "<div>foo</div>"
def test_single_div_with_children(): assert \ render(div({"className": "foo"}, [div({}, [span({}, ["foo"])])])) == \ """<div class="foo"><div><span>foo</span></div></div>"""
def test_single_div_single_child_single_attribute(): assert render(div({ "foo": "bar", "className": "foo bar" }, ["foo"])) == """<div class="foo bar" foo="bar">foo</div>"""
def render(self): return div({"class": "foo"}, ["Hello", self.props.name, self.props['surname'], "."])
def render(self): # import ipdb # ipdb.set_trace() return div({}, [HelloWorldComponent({"name": "Ustun", "surname": "Ozgur"}, []), HelloWorldComponent({"name": "Reyhan", "surname": "Ustun"}, [])])
def test_single_div_single_child_no_list_wrapping(): assert render(div({}, "foo")) == "<div>foo</div>"
def render(self): return div({"class": "foo"}, ["Hello", self.props.name, self.props['surname'], ". My name is", len(self.props.name), "characters long."])
def render(self): return div({"class": "foo"}, [ "Hello", self.props.name, self.props['surname'], ". My name is", len(self.props.name), "characters long." ])
def test_single_div_single_child_escape(): assert render(div({}, ["<foo>"])) != "<div><foo></div>"
def test_single_div_single_child_single_attribute(): assert render(div({"foo": "bar", "className": "foo bar"}, ["foo"])) == """<div class="foo bar" foo="bar">foo</div>"""