'Test the ordered enum class.'

def test_ordered_enum(self):

    class TestEnum(util.OrderedEnum, ):
        'Test    enum    that    can    be    ordered.'
        FIRST = 1
        SECOND = 2
        THIRD = 3
    self.assertTrue((TestEnum.SECOND >= TestEnum.FIRST))
    self.assertTrue((TestEnum.SECOND >= TestEnum.SECOND))
    self.assertFalse((TestEnum.SECOND >= TestEnum.THIRD))
    self.assertTrue((TestEnum.SECOND > TestEnum.FIRST))
    self.assertFalse((TestEnum.SECOND > TestEnum.SECOND))
    self.assertFalse((TestEnum.SECOND > TestEnum.THIRD))
    self.assertFalse((TestEnum.SECOND <= TestEnum.FIRST))
    self.assertTrue((TestEnum.SECOND <= TestEnum.SECOND))
    self.assertTrue((TestEnum.SECOND <= TestEnum.THIRD))
    self.assertFalse((TestEnum.SECOND < TestEnum.FIRST))
    self.assertFalse((TestEnum.SECOND < TestEnum.SECOND))
    self.assertTrue((TestEnum.SECOND < TestEnum.THIRD))
    self.assertRaises(TypeError, (lambda x, y: (x < y)), TestEnum.FIRST, 1)
    self.assertRaises(TypeError, (lambda x, y: (x <= y)), TestEnum.FIRST, 1)
    self.assertRaises(TypeError, (lambda x, y: (x > y)), TestEnum.FIRST, 1)
    self.assertRaises(TypeError, (lambda x, y: (x >= y)), TestEnum.FIRST, 1)
