Beispiel #1
0
def description_html(desc):
    """
    将用例中的描述转成HTML对象
    :param desc: 描述
    :return:
    """
    if desc is None:
        return "No case description"
    desc_ = ""
    for i in range(len(desc)):
        if i == 0:
            pass
        elif desc[i] == '\n':
            desc_ = desc_ + ";"
        else:
            desc_ = desc_ + desc[i]

    desc_lines = desc_.split(";")
    desc_html = html.html(
        html.head(
            html.meta(name="Content-Type", value="text/html; charset=latin1")),
        html.body([html.p(line) for line in desc_lines]))
    return desc_html
Beispiel #2
0
def test_singleton():
    h = html.head(html.link(href="foo"))
    assert unicode(h) == '<head><link href="foo"/></head>'

    h = html.head(html.script(src="foo"))
    assert unicode(h) == '<head><script src="foo"></script></head>'
Beispiel #3
0
def test_singleton():
    h = html.head(html.link(href="foo"))
    assert unicode(h) == '<head><link href="foo"/></head>'

    h = html.head(html.script(src="foo"))
    assert unicode(h) == '<head><script src="foo"></script></head>'