2021-01-31 22:40:30 -08:00
|
|
|
import unittest
|
|
|
|
from unittest.mock import patch, MagicMock
|
|
|
|
|
|
|
|
from gometa.ingestion.run.pipeline import Pipeline
|
|
|
|
|
|
|
|
|
|
|
|
class PipelineTest(unittest.TestCase):
|
2021-02-05 21:03:04 -08:00
|
|
|
@patch("gometa.ingestion.source.kafka.KafkaSource.get_workunits")
|
|
|
|
@patch("gometa.ingestion.sink.console.ConsoleSink.close")
|
2021-02-10 14:53:55 -08:00
|
|
|
def test_configure(self, mock_sink, mock_source):
|
2021-02-11 19:12:43 -08:00
|
|
|
pipeline = Pipeline.create(
|
2021-02-11 21:59:54 -08:00
|
|
|
{"source": {"type": "kafka", "kafka": {"bootstrap": "localhost:9092"}}, "sink": {"type": "console"}}
|
2021-02-05 21:03:04 -08:00
|
|
|
)
|
|
|
|
pipeline.run()
|
2021-01-31 22:40:30 -08:00
|
|
|
mock_source.assert_called_once()
|
|
|
|
mock_sink.assert_called_once()
|