test fixes and drop unittest2 warnings stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 21 Oct 2011 10:57:24 +0200
branchstable
changeset 783 caf114cc9c86
parent 782 ae25f5dce19a
child 784 ea252e8f058d
test fixes and drop unittest2 warnings
test/unittest_apycot.py
test/unittest_hooks.py
test/unittest_writer.py
test/utils.py
--- a/test/unittest_apycot.py	Fri Oct 21 09:50:12 2011 +0200
+++ b/test/unittest_apycot.py	Fri Oct 21 10:57:24 2011 +0200
@@ -63,7 +63,8 @@
         stream = []
         log_to_html(self.request(), '', self.checks.get_entity(0, 0).log, stream.append)
         log_html = '\n'.join(stream)
-        self.assertXMLStringWellFormed(CW_NAMESPACE_DIV % log_html)
+        self.assertWellFormed(self.get_validator(content_type='application/xml'),
+                              CW_NAMESPACE_DIV % log_html)
         for pattern, count in (
                 ('<table class="listing" id="">', 1),
                 ('<tr class="logError"', 1),
@@ -84,7 +85,8 @@
         stream = []
         log_to_html(self.request(), '', self.checks.get_entity(1, 0).log, stream.append)
         log_html = '\n'.join(stream)
-        self.assertXMLStringWellFormed(CW_NAMESPACE_DIV % log_html)
+        self.assertWellFormed(self.get_validator(content_type='application/xml'),
+                              CW_NAMESPACE_DIV % log_html)
         for pattern, count in (
                 ('<table class="listing" id="">', 1),
                 ('<tr class="logDebug"', 1),
--- a/test/unittest_hooks.py	Fri Oct 21 09:50:12 2011 +0200
+++ b/test/unittest_hooks.py	Fri Oct 21 10:57:24 2011 +0200
@@ -89,7 +89,7 @@
                      {'pe': self.lgce.eid})
         self.commit()
         # do not propagate to existing test execution
-        self.failIf('anon' in [u.login for u in plan.nosy_list])
+        self.assertFalse('anon' in [u.login for u in plan.nosy_list])
 
 
 HGREPO = os.path.join(INPUTS_DIR, u'hgrepo')
--- a/test/unittest_writer.py	Fri Oct 21 09:50:12 2011 +0200
+++ b/test/unittest_writer.py	Fri Oct 21 10:57:24 2011 +0200
@@ -31,8 +31,8 @@
             path, line, msg = self.writer._msg_info('oops %s', 'badaboum', tb=True)
         self.assertEqual(path, None)
         self.assertEqual(line, None)
-        self.failUnless(msg.startswith('oops badaboum'))
-        self.failUnless('Traceback' in msg)
+        self.assertTrue(msg.startswith('oops badaboum'))
+        self.assertTrue('Traceback' in msg)
 
 
 if __name__ == '__main__':
--- a/test/utils.py	Fri Oct 21 09:50:12 2011 +0200
+++ b/test/utils.py	Fri Oct 21 10:57:24 2011 +0200
@@ -139,7 +139,7 @@
             )
         self.vcsrepo = req.create_entity('Repository', type=u'mercurial',
                                          # use path to avoid clone attempt when using url
-                                         path=u'http://www.logilab.org/src/logilab/common',
+                                         path=u'/src/logilab/common',
                                          reverse_local_repository=self.lgce)
         self.pyp = req.create_entity('TestConfig', name=u'PYTHONPACKAGE',
                                      check_config=u'python_lint_treshold=7\n'