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


Python Switch.enabled_for方法代码示例

本文整理汇总了Python中gutter.client.models.Switch.enabled_for方法的典型用法代码示例。如果您正苦于以下问题:Python Switch.enabled_for方法的具体用法?Python Switch.enabled_for怎么用?Python Switch.enabled_for使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gutter.client.models.Switch的用法示例。


在下文中一共展示了Switch.enabled_for方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: build_and_register_switch

# 需要导入模块: from gutter.client.models import Switch [as 别名]
# 或者: from gutter.client.models.Switch import enabled_for [as 别名]
 def build_and_register_switch(self, name, enabled_for=False):
     switch = Switch(name)
     switch.enabled_for = mock.Mock(return_value=enabled_for)
     self.manager.register(switch)
     return switch
开发者ID:disqus,项目名称:gutter,代码行数:7,代码来源:test_models.py

示例2: test_switch_enabed_for_skips_switch_active_signal_when_not_enabled

# 需要导入模块: from gutter.client.models import Switch [as 别名]
# 或者: from gutter.client.models.Switch import enabled_for [as 别名]
 def test_switch_enabed_for_skips_switch_active_signal_when_not_enabled(self, signal):
     switch = Switch("foo", state=Switch.states.DISABLED)
     eq_(switch.enabled_for("causing input"), False)
     eq_(signal.call.called, False)
开发者ID:disqus,项目名称:gutter,代码行数:6,代码来源:test_models.py

示例3: test_switch_enabed_for_calls_switch_active_signal_when_enabled

# 需要导入模块: from gutter.client.models import Switch [as 别名]
# 或者: from gutter.client.models.Switch import enabled_for [as 别名]
 def test_switch_enabed_for_calls_switch_active_signal_when_enabled(self, signal):
     switch = Switch("foo", state=Switch.states.GLOBAL)
     ok_(switch.enabled_for("causing input"))
     signal.call.assert_called_once_with(switch, "causing input")
开发者ID:disqus,项目名称:gutter,代码行数:6,代码来源:test_models.py

示例4: test_switch_enabed_for_calls_switch_checked_signal

# 需要导入模块: from gutter.client.models import Switch [as 别名]
# 或者: from gutter.client.models.Switch import enabled_for [as 别名]
 def test_switch_enabed_for_calls_switch_checked_signal(self, signal):
     switch = Switch("foo")
     switch.enabled_for(True)
     signal.call.assert_called_once_with(switch)
开发者ID:disqus,项目名称:gutter,代码行数:6,代码来源:test_models.py

示例5: test_switch_enabed_for_skips_switch_active_signal_when_not_enabled

# 需要导入模块: from gutter.client.models import Switch [as 别名]
# 或者: from gutter.client.models.Switch import enabled_for [as 别名]
 def test_switch_enabed_for_skips_switch_active_signal_when_not_enabled(self, signal):
     switch = Switch('foo', manager='manager', state=Switch.states.DISABLED)
     eq_(switch.enabled_for('causing input'), False)
     eq_(signal.call.called, False)
开发者ID:gabrielpjordao,项目名称:gutter,代码行数:6,代码来源:test_models.py

示例6: test_switch_enabed_for_calls_switch_active_signal_when_enabled

# 需要导入模块: from gutter.client.models import Switch [as 别名]
# 或者: from gutter.client.models.Switch import enabled_for [as 别名]
 def test_switch_enabed_for_calls_switch_active_signal_when_enabled(self, signal):
     switch = Switch('foo', manager='manager', state=Switch.states.GLOBAL)
     ok_(switch.enabled_for('causing input'))
     signal.call.assert_called_once_with(switch, 'causing input')
开发者ID:gabrielpjordao,项目名称:gutter,代码行数:6,代码来源:test_models.py


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