Exemplo n.º 1
0
    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, )
Exemplo n.º 2
0
    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,)
Exemplo n.º 3
0
    def test_to_dict(self):
        p = Property('bla', 12, int, '\d+', True, True, '')

        assert p == Property(**p.to_dict())
Exemplo n.º 4
0
    def test_to_dict(self):
        p = Property('bla', 12, int, '\d+', True, True, '')

        assert p == Property(**p.to_dict())