本文整理匯總了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()