mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Gating the cron tests for the scheduler to ensure that the croniter module is installed before we attempt to run these tests
This commit is contained in:
parent
2f4653e271
commit
a9c36b08ff
1 changed files with 9 additions and 0 deletions
|
@ -16,6 +16,7 @@ from tests.support.mixins import SaltReturnAssertsMixin
|
|||
|
||||
# Import Salt Testing Libs
|
||||
from tests.support.mock import MagicMock, patch
|
||||
from tests.support.unit import skipIf
|
||||
import tests.integration as integration
|
||||
|
||||
# Import Salt libs
|
||||
|
@ -23,6 +24,12 @@ import salt.utils.schedule
|
|||
|
||||
from salt.modules.test import ping as ping
|
||||
|
||||
try:
|
||||
import croniter # pylint: disable=W0611
|
||||
HAS_CRONITER = True
|
||||
except ImportError:
|
||||
HAS_CRONITER = False
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
ROOT_DIR = os.path.join(integration.TMP, 'schedule-unit-tests')
|
||||
SOCK_DIR = os.path.join(ROOT_DIR, 'test-socks')
|
||||
|
@ -215,6 +222,7 @@ class SchedulerEvalTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
ret = self.schedule.job_status('job1')
|
||||
self.assertEqual(ret['_last_run'], run_time)
|
||||
|
||||
@skipIf(not HAS_CRONITER, 'Cannot find croniter python module')
|
||||
def test_eval_cron(self):
|
||||
'''
|
||||
verify that scheduled job runs
|
||||
|
@ -238,6 +246,7 @@ class SchedulerEvalTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
ret = self.schedule.job_status('job1')
|
||||
self.assertEqual(ret['_last_run'], run_time)
|
||||
|
||||
@skipIf(not HAS_CRONITER, 'Cannot find croniter python module')
|
||||
def test_eval_cron_loop_interval(self):
|
||||
'''
|
||||
verify that scheduled job runs
|
||||
|
|
Loading…
Add table
Reference in a new issue