Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
djkhl committed Aug 29, 2024
1 parent 0832968 commit f31d780
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions tests/unit/framework/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,28 +626,11 @@ def test_pipeline_result_provides_event_received(self, _):
assert result.event == {"some": "event", "field": "foo"}, "processed event is as expected"

def test_process_event_can_be_bypassed_with_no_pipeline(self, _):
self.pipeline._setup()
input_config = {
"testinput": {
"type": "http_input",
"uvicorn_config": {
"host": "127.0.0.1",
"port": 9000,
"ssl_certfile": "tests/testdata/acceptance/http_input/cert.crt",
"ssl_keyfile": "tests/testdata/acceptance/http_input/cert.key",
},
"endpoints": {"/json": "json", "/jsonl": "jsonl", "/plaintext": "plaintext"},
}
}
self.pipeline._input = original_create(input_config)
self.pipeline._input.pipeline_index = 1
self.pipeline._input.messages = multiprocessing.Queue(-1)
self.pipeline._input.setup()
self.pipeline._input.messages.put({"message": "test message"})
self.pipeline._pipeline = None
self.pipeline._pipeline = []
self.pipeline._input.get_next.return_value = ({"some": "event"}, None)
with mock.patch("logprep.framework.pipeline.Pipeline.process_event") as mock_process_event:
mock_process_event.return_value = None
result = self.pipeline.process_pipeline()
result = self.pipeline.process_pipeline()
mock_process_event.assert_not_called()
assert isinstance(result, type(None))

Expand Down

0 comments on commit f31d780

Please sign in to comment.