1 from test
.test_support
import run_unittest
, have_unicode
5 class TestImplementationComparisons(unittest
.TestCase
):
7 def test_type_comparisons(self
):
8 self
.assertTrue(str < int or str > int)
9 self
.assertTrue(int <= str or int >= str)
10 self
.assertTrue(cmp(int, str) != 0)
11 self
.assertTrue(int is int)
12 self
.assertTrue(str == str)
13 self
.assertTrue(int != str)
15 def test_cell_comparisons(self
):
25 g_cell
, = g
.func_closure
26 h_cell
, = h
.func_closure
27 self
.assertTrue(h_cell
< g_cell
)
28 self
.assertTrue(g_cell
>= h_cell
)
29 self
.assertEqual(cmp(g_cell
, h_cell
), 1)
30 self
.assertTrue(g_cell
is g_cell
)
31 self
.assertTrue(g_cell
== g_cell
)
32 self
.assertTrue(h_cell
== h_cell
)
33 self
.assertTrue(g_cell
!= h_cell
)
36 run_unittest(TestImplementationComparisons
)
38 if __name__
== '__main__':