Exemple #1
0
 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()
Exemple #2
0
 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()