本文整理汇总了Python中component.Component.plug_out_from方法的典型用法代码示例。如果您正苦于以下问题:Python Component.plug_out_from方法的具体用法?Python Component.plug_out_from怎么用?Python Component.plug_out_from使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类component.Component
的用法示例。
在下文中一共展示了Component.plug_out_from方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_test_component_inputs_failure
# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import plug_out_from [as 别名]
def test_test_component_inputs_failure(self):
"test_component_inputs should return false if an unmet input requirement exists"
the_input = Component()
the_input.state.set_flag('BAR')
requirement = lambda x: 'FOO' in x.state.flags
subject = Component()
self.assertIsInstance(the_input, Component)
subject.plug_out_from(the_input)
subject.register_component(the_input)
self.assertFalse(req.test_component_inputs(the_input, requirement))
示例2: test_test_component_outputs_pass
# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import plug_out_from [as 别名]
def test_test_component_outputs_pass(self):
"""test_component_outputs should return True if
all output requirements are met"""
requirement = lambda component : 'IS_FOO' in component.state.flags
subject = Component()
the_output = Component()
the_output.state.set_flag('IS_FOO')
subject.register_component(the_output)
the_output.plug_out_from(subject)
self.assertEqual(len(subject.item_outputs()), 1)
self.assertEqual(req.test_component_outputs(subject, requirement), True)