示例#1
0
文件: asserts.py 项目: DasIch/attest
def css():
    """Assert.css"""

    html = Assert("""
        <div id="maincontent">
            <div class="container">
                <p>Hello World</p>
            </div>
        </div>
    """)

    html.css('#maincontent .container p')[0].text == 'Hello World'

    with Assert.raises(AssertionError):
        html.css('#maincontent .container p')[0].text != 'Hello World'