Skip to content

Commit

Permalink
fix(ingest): use temp dir for file generated during test (#5505)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored Jul 27, 2022
1 parent 9b5afcc commit 64e7da8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions metadata-ingestion/tests/unit/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_configure_with_rest_sink_initializes_graph(

@freeze_time(FROZEN_TIME)
@patch("datahub.ingestion.source.kafka.KafkaSource.get_workunits", autospec=True)
def test_configure_with_file_sink_does_not_init_graph(self, mock_source):
def test_configure_with_file_sink_does_not_init_graph(self, mock_source, tmp_path):
pipeline = Pipeline.create(
{
"source": {
Expand All @@ -119,15 +119,15 @@ def test_configure_with_file_sink_does_not_init_graph(self, mock_source):
"sink": {
"type": "file",
"config": {
"filename": "test.json",
"filename": str(tmp_path / "test.json"),
},
},
}
)
# assert that the default sink config is for a DatahubRestSink
assert isinstance(pipeline.config.sink, DynamicTypedConfig)
assert pipeline.config.sink.type == "file"
assert pipeline.config.sink.config == {"filename": "test.json"}
assert pipeline.config.sink.config == {"filename": str(tmp_path / "test.json")}
assert pipeline.ctx.graph is None, "DataHubGraph should not be initialized"

@freeze_time(FROZEN_TIME)
Expand Down

0 comments on commit 64e7da8

Please sign in to comment.