def test_setup_after_cancel(self): setup = BoboSetup() setup.add_complex_event(event_def=BoboComplexEvent( name=NAME_NFA_A, pattern=stub_pattern_1, action=NoAction())) setup.config_null_data(delay_sec=NULL_DATA_DELAY, null_data=BoboNullDataStatic(DATA_DICT_A)) setup.configure() setup.start() sleep(SLEEP_WAIT) setup.cancel() self.assertFalse(setup.is_ready()) self.assertFalse(setup.is_active()) self.assertFalse(setup.is_inactive()) self.assertTrue(setup.is_cancelled()) self.assertTrue(setup.is_configured()) self.assertFalse(setup.get_receiver().is_active()) self.assertFalse(setup.get_decider().is_active()) self.assertFalse(setup.get_producer().is_active()) self.assertFalse(setup.get_forwarder().is_active()) self.assertFalse(setup.get_null_data_generator().is_active())
def test_setup_before_configure(self): setup = BoboSetup() setup.add_complex_event(event_def=BoboComplexEvent( name=NAME_NFA_A, pattern=stub_pattern_1, action=NoAction())) setup.config_null_data(delay_sec=NULL_DATA_DELAY, null_data=BoboNullDataStatic(DATA_DICT_A)) self.assertFalse(setup.is_ready()) self.assertFalse(setup.is_active()) self.assertTrue(setup.is_inactive()) self.assertFalse(setup.is_cancelled()) self.assertFalse(setup.is_configured())