本文整理汇总了Python中test.__common.NotifyTestObject.simple_handler方法的典型用法代码示例。如果您正苦于以下问题:Python NotifyTestObject.simple_handler方法的具体用法?Python NotifyTestObject.simple_handler怎么用?Python NotifyTestObject.simple_handler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test.__common.NotifyTestObject
的用法示例。
在下文中一共展示了NotifyTestObject.simple_handler方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_derivation_3
# 需要导入模块: from test.__common import NotifyTestObject [as 别名]
# 或者: from test.__common.NotifyTestObject import simple_handler [as 别名]
def test_derivation_3 (self):
test = NotifyTestObject ()
DerivedCondition = \
AbstractStateTrackingCondition.derive_type ('DerivedCondition',
setter = (lambda condition, state:
test.simple_handler (state)))
condition = DerivedCondition (False)
condition.set (True)
condition.state = False
# There is no getter at all, so setter must be called during condition creation.
test.assert_results (False, True, False)
示例2: test_derivation_9
# 需要导入模块: from test.__common import NotifyTestObject [as 别名]
# 或者: from test.__common.NotifyTestObject import simple_handler [as 别名]
def test_derivation_9 (self):
test = NotifyTestObject ()
DerivedVariable = \
AbstractValueTrackingVariable.derive_type ('DerivedVariable',
setter = (lambda variable, value:
test.simple_handler (value)))
variable = DerivedVariable ()
variable.set (100)
variable.value = 'abc'
# There is no getter at all, so setter must be called during variable creation.
test.assert_results (None, 100, 'abc')
示例3: test_derivation_2
# 需要导入模块: from test.__common import NotifyTestObject [as 别名]
# 或者: from test.__common.NotifyTestObject import simple_handler [as 别名]
def test_derivation_2 (self):
test = NotifyTestObject ()
DerivedCondition = \
AbstractStateTrackingCondition.derive_type ('DerivedCondition',
getter = lambda condition: False,
setter = (lambda condition, state:
test.simple_handler (state)))
condition = DerivedCondition ()
condition.set (True)
condition.state = False
# The default state is retrieved with the getter function, so the setter must not
# be called during condition creation.
test.assert_results (True, False)
示例4: test_derivation_8
# 需要导入模块: from test.__common import NotifyTestObject [as 别名]
# 或者: from test.__common.NotifyTestObject import simple_handler [as 别名]
def test_derivation_8 (self):
test = NotifyTestObject ()
DerivedVariable = \
AbstractValueTrackingVariable.derive_type ('DerivedVariable',
getter = lambda variable: None,
setter = (lambda variable, value:
test.simple_handler (value)))
variable = DerivedVariable ()
variable.set (100)
variable.value = 'abc'
# The default value is retrieved with the getter function, so the setter must not
# be called during variable creation.
test.assert_results (100, 'abc')