fix tests from mlz repo
- fix omit_unchanged - names too short + other pylint complains Change-Id: I3c277b461fad1a5fdf8e76ff1cc42b8742d1de16 Change-Id: I58fb64f91bcc2efef20df68f5c63a64315413286
This commit is contained in:
@@ -162,23 +162,23 @@ def test_Property_override():
|
||||
|
||||
|
||||
def test_Properties_mro():
|
||||
class A(HasProperties):
|
||||
p = Property('base', StringType(), 'base', export='always')
|
||||
class Base(HasProperties):
|
||||
prop = Property('base', StringType(), 'base', export='always')
|
||||
|
||||
class B(A):
|
||||
class SubA(Base):
|
||||
pass
|
||||
|
||||
class C(A):
|
||||
p = Property('sub', FloatRange(), extname='p')
|
||||
class SubB(Base):
|
||||
prop = Property('sub', FloatRange(), extname='prop')
|
||||
|
||||
class D(C, B):
|
||||
p = 1
|
||||
class FinalBA(SubB, SubA):
|
||||
prop = 1
|
||||
|
||||
class E(B, C):
|
||||
p = 2
|
||||
class FinalAB(SubA, SubB):
|
||||
prop = 2
|
||||
|
||||
assert B().exportProperties() == {'_p': 'base'}
|
||||
assert D().exportProperties() == {'p': 1.0}
|
||||
# in an older implementation the following would fail, as B.p is constructed first
|
||||
# and then B.p overrides C.p
|
||||
assert E().exportProperties() == {'p': 2.0}
|
||||
assert SubA().exportProperties() == {'_prop': 'base'}
|
||||
assert FinalBA().exportProperties() == {'prop': 1.0}
|
||||
# in an older implementation the following would fail, as SubA.p is constructed first
|
||||
# and then SubA.p overrides SubB.p
|
||||
assert FinalAB().exportProperties() == {'prop': 2.0}
|
||||
|
||||
Reference in New Issue
Block a user