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,))
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))
def test_validate_events_single_invalid_event(self): with self.assertRaises(UnknownEvent): validate_events(events=WalkoffEvent.CommonWorkflowSignal, allowed_events=(WalkoffEvent.SchedulerStart, ))
def test_validate_events_too_few_events(self): self.assertSetEqual( validate_events(events=WalkoffEvent.CommonWorkflowSignal), {WalkoffEvent.CommonWorkflowSignal})
def test_validate_events_no_available_events(self): with self.assertRaises(UnknownEvent): validate_events(events=[WalkoffEvent.CommonWorkflowSignal], allowed_events=[])
def test_validate_events_no_events(self): self.assertSetEqual(set(validate_events(events=[])), set())