Пример #1
0
 def test_validate_events_all_events_specified_available_events(self):
     available_events = (WalkoffEvent.CommonWorkflowSignal,
                         WalkoffEvent.SchedulerStart)
     self.assertSetEqual(validate_events(allowed_events=available_events),
                         set(available_events))
 def test_validate_events_single_invalid_event(self):
     with self.assertRaises(UnknownEvent):
         validate_events(events=WalkoffEvent.CommonWorkflowSignal,
                         allowed_events=(WalkoffEvent.SchedulerStart,))
Пример #3
0
 def test_validate_events_all_events_default_available_events(self):
     self.assertEqual(validate_events(), set(WalkoffEvent))
 def test_validate_events_no_available_events(self):
     with self.assertRaises(UnknownEvent):
         validate_events(events=[WalkoffEvent.CommonWorkflowSignal], allowed_events=[])
 def test_validate_events_too_few_events(self):
     self.assertSetEqual(validate_events(events=WalkoffEvent.CommonWorkflowSignal),
                         {WalkoffEvent.CommonWorkflowSignal})
 def test_validate_events_all_events_specified_available_events(self):
     available_events = (WalkoffEvent.CommonWorkflowSignal, WalkoffEvent.SchedulerStart)
     self.assertSetEqual(validate_events(allowed_events=available_events), set(available_events))
 def test_validate_events_no_events(self):
     self.assertSetEqual(set(validate_events(events=[])), set())
 def test_validate_events_all_events_default_available_events(self):
     self.assertEqual(validate_events(), set(WalkoffEvent))
Пример #9
0
 def test_validate_events_single_invalid_event(self):
     with self.assertRaises(UnknownEvent):
         validate_events(events=WalkoffEvent.CommonWorkflowSignal,
                         allowed_events=(WalkoffEvent.SchedulerStart, ))
Пример #10
0
 def test_validate_events_too_few_events(self):
     self.assertSetEqual(
         validate_events(events=WalkoffEvent.CommonWorkflowSignal),
         {WalkoffEvent.CommonWorkflowSignal})
Пример #11
0
 def test_validate_events_no_available_events(self):
     with self.assertRaises(UnknownEvent):
         validate_events(events=[WalkoffEvent.CommonWorkflowSignal],
                         allowed_events=[])
Пример #12
0
 def test_validate_events_no_events(self):
     self.assertSetEqual(set(validate_events(events=[])), set())