-
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.
KeyError on retrieving an ExtractionPipeline with partial contact inf…
…ormation (#2056)
- Loading branch information
Showing
5 changed files
with
48 additions
and
16 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
__version__ = "7.70.1" | ||
__version__ = "7.70.2" | ||
|
||
__api_subversion__ = "20230101" |
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
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() |