def doTest(): text = 'body {width: 1px}' logs, warns, errors = doCssCheck(text) equal(len(logs), 2, 'two logs') equal(len(warns), 1, 'one warn happened') equal(len(errors), 1, 'one error happened') equal(warns[0], r'each rule in "body" need semicolon in the end, "width" has not', 'warn rule text is ok') equal(errors[0], r'should not set style for html tag in "body"', 'error rule text is ok')
def doTest(): logs, warns, errors = doCssTextCheck('/* @author: zhifu.wang**/ /* .test {width: 100px;}*/', 'test.css') equal(len(errors), 1, 'one error occur') equal(fill(errors[0]), 'empty css file "test.css"') logs, warns, errors = doCssTextCheck('/* @author: zhifu.wang**/ /* .test {width: 100px;}*/ \n.test { width: 100px; }', 'test.css') equal(len(errors), 0, 'no error now')
def doTest(): logs, warns, errors = doCssTextCheck('/* @author: zhifu.wang**/ /* .test {width: 100px;}*/', 'test.css') equal(len(errors), 1, 'one error occur') equal(errors[0], 'empty css file "test.css"') logs, warns, errors = doCssTextCheck('/* @author: zhifu.wang**/ /* .test {width: 100px;}*/ \n.test { width: 100px; }', 'test.css') equal(len(errors), 0, 'no error now')
def test_search(self): page = GoogleSearch(context) print(page.context) asserts.equal('3', 3)