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_replace_value(self): p = Property(value='original') assert 'new' == p.replace(value='new').value assert 'original' == p.replace(value=None).value
def test_replace_without_values(self): p = Property('a', 5, int, '\d+', False, False, 'doc') assert p == p.replace() assert p == p.replace(**dict.fromkeys(self.attributes))
def test_replace_value(self): p = Property(value='original') assert 'new' == p.replace(value='new').value assert 'original' == p.replace(value=None).value
def test_replace_without_values(self): p = Property('a', 5, int, '\d+', False, False, 'doc') assert p == p.replace() assert p == p.replace(**dict.fromkeys(self.attributes))