當前位置: 首頁>>代碼示例>>Python>>正文


Python FormulaBase.should_run方法代碼示例

本文整理匯總了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()
開發者ID:tmckay,項目名稱:sprinter,代碼行數:10,代碼來源:formulabase_test.py

示例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()
開發者ID:tmckay,項目名稱:sprinter,代碼行數:14,代碼來源:formulabase_test.py


注:本文中的sprinter.formulabase.FormulaBase.should_run方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。