class Mock(MockInstrument): def __init__(self): super(Mock, self).__init__() self._value = 0 def mockset(self, newval): self._value = newval mockproperty = rproperty(fget=None, fset=mockset, writeonly=True)
class Mock(MockInstrument): def __init__(self): super(Mock, self).__init__() self._value = 0 def mockget(self): return self._value mockproperty = rproperty(fget=mockget, fset=None, readonly=True)
class Mock(MockInstrument): def __init__(self): super(Mock, self).__init__() self._value = 0 def mockget(self): # pragma: no cover return self._value mockproperty = rproperty(fget=mockget, fset=None, writeonly=True)
class Mock(MockInstrument): def __init__(self): super(Mock, self).__init__() self._value = 0 def mockset(self, newval): # pragma: no cover self._value = newval mockproperty = rproperty(fget=None, fset=mockset, readonly=True)
class Mock(MockInstrument): def __init__(self): super(Mock, self).__init__() self._value = 0 def mockget(self): return self._value def mockset(self, newval): self._value = newval mockproperty = rproperty(fget=mockget, fset=mockset)
def test_rproperty_readonly_and_writeonly(): _ = rproperty(readonly=True, writeonly=True)
def test_rproperty_readonly_and_writeonly(): with pytest.raises(ValueError): _ = rproperty(readonly=True, writeonly=True)