示例#1
0
 def render(self):
     # import ipdb
     # ipdb.set_trace()
     return div({}, [
         HelloWorldComponent({
             "name": "Ustun",
             "surname": "Ozgur"
         }, []),
         HelloWorldComponent({
             "name": "Reyhan",
             "surname": "Ustun"
         }, [])
     ])
示例#2
0
 def render(self):
     return div(["Hello", self.props.name, self.props['surname']])
示例#3
0
 def render(self):
     return div({},
                [div({}, ["Hello World"]),
                 div({}, ["Hello World"])])
示例#4
0
def test_single_div_single_child():
    assert render(div({}, ["foo"])) == "<div>foo</div>"
示例#5
0
def test_single_div_with_children():
    assert \
        render(div({"className": "foo"},
                   [div({},
                        [span({}, ["foo"])])])) == \
        """<div class="foo"><div><span>foo</span></div></div>"""
示例#6
0
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>"""
示例#7
0
def test_single_div_with_children():
    assert \
        render(div({"className": "foo"},
                   [div({},
                        [span({}, ["foo"])])])) == \
        """<div class="foo"><div><span>foo</span></div></div>"""
示例#8
0
 def render(self):
     return div({"class": "foo"},
                ["Hello", self.props.name, self.props['surname'], "."])
示例#9
0
 def render(self):
     # import ipdb
     # ipdb.set_trace()
     return div({},
                [HelloWorldComponent({"name": "Ustun", "surname": "Ozgur"}, []),
                 HelloWorldComponent({"name": "Reyhan", "surname": "Ustun"}, [])])
示例#10
0
 def render(self):
     return div({"class": "foo"},
                ["Hello", self.props.name, self.props['surname'], "."])
示例#11
0
def test_single_div_single_child_no_list_wrapping():
    assert render(div({}, "foo")) == "<div>foo</div>"
示例#12
0
 def render(self):
     return div({"class": "foo"},
                ["Hello", self.props.name, self.props['surname'], ". My name is", len(self.props.name), "characters long."])
示例#13
0
 def render(self):
     return div(["Hello", self.props.name, self.props['surname']])
示例#14
0
 def render(self):
     return div({}, [div({}, ["Hello World"]), div({}, ["Hello World"])])
示例#15
0
def test_single_div_single_child():
    assert render(div({}, ["foo"])) == "<div>foo</div>"
示例#16
0
 def render(self):
     return div({"class": "foo"}, [
         "Hello", self.props.name, self.props['surname'],
         ". My name is",
         len(self.props.name), "characters long."
     ])
示例#17
0
def test_single_div_single_child_no_list_wrapping():
    assert render(div({}, "foo")) == "<div>foo</div>"
示例#18
0
def test_single_div_single_child_escape():
    assert render(div({}, ["<foo>"])) != "<div><foo></div>"
示例#19
0
def test_single_div_single_child_escape():
    assert render(div({}, ["<foo>"])) != "<div><foo></div>"
示例#20
0
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>"""