def test_immutable(self): p = Property() assert p is not p.replace(**p.to_dict()) for attrname in self.attributes: try: setattr(p, attrname, None) except AttributeError: pass else: assert False, 'must not be able to change %r ' % (attrname, )
def test_immutable(self): p = Property() assert p is not p.replace(**p.to_dict()) for attrname in self.attributes: try: setattr(p, attrname, None) except AttributeError: pass else: assert False, 'must not be able to change %r ' % (attrname,)
def test_to_dict(self): p = Property('bla', 12, int, '\d+', True, True, '') assert p == Property(**p.to_dict())