本文整理汇总了Python中sprinter.formulabase.FormulaBase.should_run方法的典型用法代码示例。如果您正苦于以下问题:Python FormulaBase.should_run方法的具体用法?Python FormulaBase.should_run怎么用?Python FormulaBase.should_run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sprinter.formulabase.FormulaBase
的用法示例。
在下文中一共展示了FormulaBase.should_run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_debianbased_only
# 需要导入模块: from sprinter.formulabase import FormulaBase [as 别名]
# 或者: from sprinter.formulabase.FormulaBase import should_run [as 别名]
def test_debianbased_only(self):
""" Test a feature that should only occur on debian-based distributions """
fb = FormulaBase(self.environment, 'debian',
target=self.environment.target.get_feature_config('debian'))
self.system.isDebianBased = Mock(return_value=True)
assert fb.should_run()
self.system.isDebianBased = Mock(return_value=False)
assert not fb.should_run()
示例2: test_osx_only
# 需要导入模块: from sprinter.formulabase import FormulaBase [as 别名]
# 或者: from sprinter.formulabase.FormulaBase import should_run [as 别名]
def test_osx_only(self):
""" Test a feature that should only occur on osx """
fb = FormulaBase(self.environment, 'osx',
target=self.environment.target.get_feature_config('osx'))
fb2 = FormulaBase(self.environment, 'osx2',
target=self.environment.target.get_feature_config('osx2'))
self.system.isOSX = Mock(return_value=True)
assert fb.should_run()
assert fb2.should_run()
self.system.isOSX = Mock(return_value=False)
assert not fb.should_run()
assert not fb2.should_run()