fix overriding Parameter with value
a property declared in a base class may be overriden with a parameter in a subclass. this is already allowed. if then, in the subsubclass it is overridden by a bare value, it fails. Patchset 1: add a test for this Patchset 4: add the fix Change-Id: Ia5a26076a9ee98439932643a03878342d56f8396 Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/35932 Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch> Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
This commit is contained in:
@ -31,6 +31,7 @@ from frappy.modules import Communicator, Drivable, Readable, Module, Writable
|
||||
from frappy.params import Command, Parameter, Limit
|
||||
from frappy.rwhandler import ReadHandler, WriteHandler, nopoll
|
||||
from frappy.lib import generalConfig
|
||||
from frappy.properties import Property
|
||||
|
||||
|
||||
class DispatcherStub:
|
||||
@ -445,6 +446,15 @@ def test_override():
|
||||
# inherit doc string
|
||||
assert Mod2.stop.description == Mod.stop.description
|
||||
|
||||
class Base(Module):
|
||||
attr = Property('test property', FloatRange())
|
||||
|
||||
class Subclass(Base):
|
||||
attr = Parameter('test parameter', FloatRange())
|
||||
|
||||
class SubSubclass(Subclass): # pylint: disable=unused-variable
|
||||
attr = 5.0
|
||||
|
||||
|
||||
def test_command_config():
|
||||
class Mod(Module):
|
||||
|
Reference in New Issue
Block a user