Exemple #1
0
    def test_less_than_other_types(self):
        # RichEnumValues are always < values of other types
        self.assertLess(Vegetable.OKRA, Vegetable.OKRA.canonical_name)
        self.assertLess(Vegetable.OKRA, 11)
        self.assertLess(Vegetable.OKRA, {'foo': 'bar'})

        # ...even if the other type is also descended from RichEnumValue
        other_okra = RichEnumValue('okra', 'Okra')
        self.assertLess(Vegetable.OKRA, other_okra)
Exemple #2
0
    def test_not_equal_to_other_types(self):
        self.assertNotEqual(Vegetable.OKRA, None)
        # RichEnumValues are always != values of other types
        self.assertNotEqual(Vegetable.OKRA, Vegetable.OKRA.canonical_name)
        self.assertNotEqual(Vegetable.OKRA, 11)
        self.assertNotEqual(Vegetable.OKRA, {'foo': 'bar'})

        # ...even if the other type is also descended from RichEnumValue
        other_okra = RichEnumValue('okra', 'Okra')
        self.assertNotEqual(Vegetable.OKRA, other_okra)
Exemple #3
0
class AudioFormat(RichEnumValue):
    A8k_16bit_PCM = RichEnumValue(canonical_name="A8k_16bit_PCM",
                                  display_name="A8k_16bit_PCM")
    A16k_16bit_PCM = RichEnumValue(canonical_name="A16k_16bit_PCM",
                                   display_name="A16k_16bit_PCM")
    A8k_A_law = RichEnumValue(canonical_name="A8k_A_law",
                              display_name="A8k_A_law")
    A16k_A_law = RichEnumValue(canonical_name="A16k_A_law",
                               display_name="A16k_A_law")
    A8k_U_law = RichEnumValue(canonical_name="A8k_U_law",
                              display_name="A8k_U_law")
    A16k_U_law = RichEnumValue(canonical_name="A16k_U_law",
                               display_name="A16k_U_law")
Exemple #4
0
class Encoding(RichEnumValue):
    pcm = RichEnumValue(canonical_name=1, display_name=1)
    alaw = RichEnumValue(canonical_name=6, display_name=6)
Exemple #5
0
class Rate(RichEnumValue):
    Hz8k = RichEnumValue(canonical_name=8000, display_name=8000)
    Hz16k = RichEnumValue(canonical_name=16000, display_name=16000)
Exemple #6
0
class Bits(RichEnumValue):
    bit8 = RichEnumValue(canonical_name=8, display_name=8)
    bit16 = RichEnumValue(canonical_name=16, display_name=16)
Exemple #7
0
class Channel(RichEnumValue):
    mono = RichEnumValue(canonical_name=1, display_name=1)
    Stereo = RichEnumValue(canonical_name=2, display_name=2)
Exemple #8
0
 class MixedBreakfast(OrderedRichEnum):
     COFFEE = coffee
     TEA = RichEnumValue('tea', 'Tea')
Exemple #9
0
 class Medley(RichEnum):
     OKRA = okra
     PARSNIP = RichEnumValue('carrot', 'Carrot')
Exemple #10
0
 class Meat(RichEnum):
     COW = RichEnumValue("cow", "Cow")