Fix unit tests for croniter>=1.2.0

Since croniter 1.2.0, day=0 is no longer accepted as a valid value[1].
Because of this change, some unit tests are failing with the following
error.

Invalid CRON expression: [* * 0 * *] is not acceptable, out of range

This change updates the pattern used in unit tests so that the value
is accepted by the latest croniter.

[1] 17953c8fa7

Change-Id: Ib9ee765e89716583b8f28cc9aafd9cb4e8e8e1cb
This commit is contained in:
Takashi Kajinami 2022-01-17 19:44:02 +09:00
parent 9af3af156b
commit 9ed612906e

View File

@ -28,7 +28,7 @@ resources:
type: OS::Mistral::CronTrigger
properties:
name: my_cron_trigger
pattern: "* * 0 * *"
pattern: "* * 1 * *"
workflow: {'name': 'get_first_glance_image', 'input': {} }
count: 3
first_time: "2015-04-08 06:20"
@ -77,7 +77,7 @@ class MistralCronTriggerTest(common.HeatTestCase):
expected_state = (ct.CREATE, ct.COMPLETE)
self.assertEqual(expected_state, ct.state)
args, kwargs = self.client.cron_triggers.create.call_args
self.assertEqual('* * 0 * *', kwargs['pattern'])
self.assertEqual('* * 1 * *', kwargs['pattern'])
self.assertEqual('get_first_glance_image', args[1])
self.assertEqual({}, kwargs['workflow_input'])
self.assertEqual('2015-04-08 06:20', kwargs['first_time'])