当前位置: 首页>>代码示例>>Python>>正文


Python NotifyTestObject.simple_handler方法代码示例

本文整理汇总了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)
开发者ID:Distrotech,项目名称:python-notify,代码行数:16,代码来源:condition.py

示例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')
开发者ID:Distrotech,项目名称:python-notify,代码行数:16,代码来源:variable.py

示例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)
开发者ID:Distrotech,项目名称:python-notify,代码行数:18,代码来源:condition.py

示例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')
开发者ID:Distrotech,项目名称:python-notify,代码行数:18,代码来源:variable.py


注:本文中的test.__common.NotifyTestObject.simple_handler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。