def CheckList(self, l):
    if not l.head:
      self.assertFalse(bool(l.tail))
    self.assertFalse(bool(l.head.prev))
    self.assertFalse(bool(l.tail.next))

    p = self.head
    p1 = self.head.next
    while p1:
      self.assertEqual(p1.prev, p)
      p = p1
      p1 = p1.next
    self.assertEqual(p, self.tail)
Quickly checks if the list is sane.
dataset/ETHPy150Open google/grr/grr/lib/utils_test.py/UtilsTest.CheckList