-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: made all properties of ExtractionPipelineContact optional
- Loading branch information
Showing
2 changed files
with
40 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
tests/tests_unit/test_data_classes/test_extraction_pipipelines.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from typing import Any | ||
|
||
import pytest | ||
|
||
from cognite.client.data_classes.extractionpipelines import ExtractionPipelineContact | ||
|
||
|
||
class TestExtractionPipeline: | ||
@pytest.mark.parametrize( | ||
"raw, expected", | ||
[ | ||
pytest.param( | ||
{"name": "Homer", "email": "[email protected]"}, | ||
ExtractionPipelineContact(name="Homer", email="[email protected]"), | ||
id="Partial Contact", | ||
), | ||
pytest.param( | ||
{"name": "Marge", "email": "[email protected]", "role": "Wife", "sendNotification": True}, | ||
ExtractionPipelineContact( | ||
name="Marge", email="[email protected]", role="Wife", send_notification=True | ||
), | ||
id="Full Contact", | ||
), | ||
], | ||
) | ||
def test_load_dump_contracts(self, raw: dict[str, Any], expected: ExtractionPipelineContact) -> None: | ||
loaded = ExtractionPipelineContact._load(raw) | ||
assert loaded == expected | ||
assert raw == loaded.dump() |