def test_pipeline_start_no_elements(): Pipeline.PIPELINE_OPS["source"] = _TestSourceElement4 pipeline_config = [{"source": "unavailable"}] pipeline = _TestPipeline(pname="test", pconfig=pipeline_config) assert len(pipeline._pipe_elements) == 0 pipeline.start() assert pipeline._test_on_start_no_elements_called
def test_pipeline_start2(): conf = _get_pipeline_config_2_elements() pipeline = _TestPipeline(pname='test', pconfig=conf) assert len(pipeline._pipe_elements) == 2 assert isinstance(pipeline._pipe_elements[0], _TestSourceElement) assert isinstance(pipeline._pipe_elements[1], _TestDummyElement) pipeline.start() dummy = pipeline._pipe_elements[1] assert dummy._sample_processed pipeline.stop()
def test_pipeline_heal2(): Pipeline.PIPELINE_OPS['source'] = _TestSourceElement4 pipeline_config = [ {'source': {'uri': 'test'}}, ] pipeline = _TestPipeline(pname='test', pconfig=pipeline_config) assert len(pipeline._pipe_elements) == 1 assert isinstance(pipeline._pipe_elements[0], _TestSourceElement4) pipeline.start() pipeline.heal() assert not pipeline._test_on_healing_already_in_progress_called pipeline.heal() assert pipeline._test_on_healing_already_in_progress_called pipeline.stop()
def test_pipeline_start_no_elements(): Pipeline.PIPELINE_OPS['source'] = _TestSourceElement4 pipeline_config = [ { 'source': { 'uri': 'test' } }, ] pipeline = _TestPipeline(pname='test', pconfig=pipeline_config) assert len(pipeline._pipe_elements) == 1 pipeline._pipe_elements.pop() pipeline.start() assert pipeline._test_on_start_no_elements_called
def test_pipeline_heal2(): Pipeline.PIPELINE_OPS["source"] = _TestSourceElement4 pipeline_config = [ { "source": { "uri": "test" } }, ] pipeline = _TestPipeline(pname="test", pconfig=pipeline_config) assert len(pipeline._pipe_elements) == 1 assert isinstance(pipeline._pipe_elements[0], _TestSourceElement4) pipeline.start() pipeline.heal() assert not pipeline._test_on_healing_already_in_progress_called pipeline.heal() assert pipeline._test_on_healing_already_in_progress_called pipeline.stop()