def test_assign_wrong_field_to_known_position(self): s1 = Segment('MSH',validation_level=VALIDATION_LEVEL.STRICT) s2 = Segment('QPD') with self.assertRaises(ChildNotValid): s1.msh_10 = Field('spm_10') with self.assertRaises(ChildNotValid): s2.qpd_3 = Field('pid_3')
def test_assign_field_by_get(self): s = Segment('MSH') s.msh_10 = 'Value' s.msh_10.msh_10_1 = 'Value'