Example #1
0
 def test_derivation_dict_3(self):
     # But test it notices there is a dict already over intermediate type.
     DerivedType3 = (AbstractValueObject.derive_type(
         'DerivedType1',
         dict=True).derive_type('DerivedType2').derive_type('DerivedType3',
                                                            dict=True))
     DerivedType3().this_attribute_isnt_declared_but_there_is_a_dict = None
Example #2
0
 def test_derivation_dict_2(self):
     # Test that derivation mechanism gracefully ignores second `dict'.
     DerivedType2 = (AbstractValueObject.derive_type('DerivedType1',
                                                     dict=True).derive_type(
                                                         'DerivedType2',
                                                         dict=True))
     DerivedType2().this_attribute_isnt_declared_but_there_is_a_dict = None
Example #3
0
 def test_derivation_dict_1 (self):
     DerivedType1 = AbstractValueObject.derive_type ('DerivedType1', dict = True)
     DerivedType1 ().this_attribute_isnt_declared_but_there_is_a_dict = None
Example #4
0
 def test_derivation_slots (self):
     DerivedType = AbstractValueObject.derive_type ('DerivedType')
     self.assertRaises (AttributeError, self.non_existing_attribute_setter (DerivedType ()))
Example #5
0
 def test_derivation_dict_1(self):
     DerivedType1 = AbstractValueObject.derive_type('DerivedType1',
                                                    dict=True)
     DerivedType1().this_attribute_isnt_declared_but_there_is_a_dict = None
Example #6
0
 def test_derivation_slots(self):
     DerivedType = AbstractValueObject.derive_type('DerivedType')
     self.assertRaises(AttributeError,
                       self.non_existing_attribute_setter(DerivedType()))