devtools/test/unittest_testlib.py
changeset 4766 162b2b127b15
parent 4473 f2f5576aa6ef
child 4770 860c4128236c
equal deleted inserted replaced
4764:ec9c20c6b9f7 4766:162b2b127b15
    13 from logilab.common.testlib import (TestCase, unittest_main, 
    13 from logilab.common.testlib import (TestCase, unittest_main, 
    14                                     SkipAwareTextTestRunner)
    14                                     SkipAwareTextTestRunner)
    15 
    15 
    16 from cubicweb.devtools import htmlparser
    16 from cubicweb.devtools import htmlparser
    17 from cubicweb.devtools.testlib import CubicWebTC
    17 from cubicweb.devtools.testlib import CubicWebTC
       
    18 from cubicweb.pytestconf import clean_repo_test_cls
    18 
    19 
    19 class WebTestTC(TestCase):
    20 class WebTestTC(TestCase):
    20 
    21 
    21     def setUp(self):
    22     def setUp(self):
    22         output = StringIO()
    23         output = StringIO()
    35         tests = [MyWebTest('test_error_view'), MyWebTest('test_correct_view')]
    36         tests = [MyWebTest('test_error_view'), MyWebTest('test_correct_view')]
    36         result = self.runner.run(TestSuite(tests))
    37         result = self.runner.run(TestSuite(tests))
    37         self.assertEquals(result.testsRun, 2)
    38         self.assertEquals(result.testsRun, 2)
    38         self.assertEquals(len(result.errors), 0)
    39         self.assertEquals(len(result.errors), 0)
    39         self.assertEquals(len(result.failures), 1)
    40         self.assertEquals(len(result.failures), 1)
    40 
    41         clean_repo_test_cls(MyWebTest)
    41 
    42 
    42 
    43 
    43 HTML_PAGE = u"""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    44 HTML_PAGE = u"""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    44 <html>
    45 <html>
    45   <head><title>need a title</title></head>
    46   <head><title>need a title</title></head>