

def test_comparisons(self):
    st1 = parser.expr('2 + 3')
    st2 = parser.suite('x = 2; y = x + 3')
    st3 = parser.expr('list(x**3 for x in range(20))')
    st1_copy = parser.expr('2 + 3')
    st2_copy = parser.suite('x = 2; y = x + 3')
    st3_copy = parser.expr('list(x**3 for x in range(20))')
    self.assertEqual((st1 == st1), True)
    self.assertEqual((st2 == st2), True)
    self.assertEqual((st3 == st3), True)
    self.assertEqual(st1, st1_copy)
    self.assertEqual(st2, st2_copy)
    self.assertEqual(st3, st3_copy)
    self.assertEqual((st1 == st2), False)
    self.assertEqual((st1 == st3), False)
    self.assertEqual((st2 == st3), False)
    self.assertEqual((st1 != st1), False)
    self.assertEqual((st2 != st2), False)
    self.assertEqual((st3 != st3), False)
    self.assertEqual((st1 != st1_copy), False)
    self.assertEqual((st2 != st2_copy), False)
    self.assertEqual((st3 != st3_copy), False)
    self.assertEqual((st2 != st1), True)
    self.assertEqual((st1 != st3), True)
    self.assertEqual((st3 != st2), True)
    self.assertEqual((st1 < st2), (not (st2 <= st1)))
    self.assertEqual((st1 < st3), (not (st3 <= st1)))
    self.assertEqual((st2 < st3), (not (st3 <= st2)))
    self.assertEqual((st1 < st2), (st2 > st1))
    self.assertEqual((st1 < st3), (st3 > st1))
    self.assertEqual((st2 < st3), (st3 > st2))
    self.assertEqual((st1 <= st2), (st2 >= st1))
    self.assertEqual((st3 <= st1), (st1 >= st3))
    self.assertEqual((st2 <= st3), (st3 >= st2))
    bottom = min(st1, st2, st3)
    top = max(st1, st2, st3)
    mid = sorted([st1, st2, st3])[1]
    self.assertTrue((bottom < mid))
    self.assertTrue((bottom < top))
    self.assertTrue((mid < top))
    self.assertTrue((bottom <= mid))
    self.assertTrue((bottom <= top))
    self.assertTrue((mid <= top))
    self.assertTrue((bottom <= bottom))
    self.assertTrue((mid <= mid))
    self.assertTrue((top <= top))
    self.assertEqual((st1 == 1588.602459), False)
    self.assertEqual(('spanish armada' != st2), True)
    self.assertRaises(TypeError, operator.ge, st3, None)
    self.assertRaises(TypeError, operator.le, False, st1)
    self.assertRaises(TypeError, operator.lt, st1, 1815)
    self.assertRaises(TypeError, operator.gt, b'waterloo', st2)

dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/test/test_parser.py STObjectTestCase.test_comparisons/original