Example #1
0
 def test(self):
   lock = Lock(15)
   lock.aquire()
   r = validate(self.markups)
   c = 0
   for line in r:
     if '''class="msg_err"''' in line:
       c = 10
     if c > 0:
       print line,
       c -= 1
   print r.info()
   self.assertEqual(r.info()['X-W3C-Validator-Status'], 'Valid')
   lock.release()
Example #2
0
 def test_as_html(self):
   formatter = Formatter(self.input, self.output)
   formatter.html()
   self.output.seek(0)
   lock = Lock(15)
   lock.aquire()
   r = validate(self.output)
   lock.release()
   c = 0
   for line in r:
     if '''class="msg_err"''' in line:
       c = 10
     if c > 0:
       print line,
       c -= 1
   self.output.seek(0)
   x = file('hoge8', 'wb')
   x.write(self.output.getvalue())
   x.close()
   print r.info()
   self.assertEqual(r.info()['X-W3C-Validator-Status'], 'Valid')
   self.assertEqual(int(r.info()['X-W3C-Validator-Errors']), 0)