-
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.
- Loading branch information
Showing
5 changed files
with
122 additions
and
81 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
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
35 changes: 20 additions & 15 deletions
35
tests/tests_unit/test_data_classes/test_hosted_extractors/test_jobs.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 |
---|---|---|
@@ -1,23 +1,28 @@ | ||
import textwrap | ||
|
||
import yaml | ||
|
||
from cognite.client.data_classes.hosted_extractors.jobs import Job | ||
|
||
|
||
class TestJob: | ||
def test_load_yaml_dump_unknown_config(self) -> None: | ||
raw_yaml = """externalId: myJob | ||
sourceId: my_eventhub | ||
destinationId: EventHubTarget | ||
targetStatus: running | ||
status: running | ||
createdTime: 123 | ||
lastUpdatedTime: 1234 | ||
format: | ||
type: value | ||
encoding: utf16 | ||
compression: gzip | ||
config: | ||
some: new_config | ||
that: has not been seen before""" | ||
|
||
raw_yaml = textwrap.dedent( | ||
"""\ | ||
externalId: myJob | ||
sourceId: my_eventhub | ||
destinationId: EventHubTarget | ||
targetStatus: running | ||
status: running | ||
createdTime: 123 | ||
lastUpdatedTime: 1234 | ||
format: | ||
type: value | ||
encoding: utf16 | ||
compression: gzip | ||
config: | ||
some: new_config | ||
that: has not been seen before | ||
""" | ||
) | ||
assert Job.load(raw_yaml).dump() == yaml.safe_load(raw_yaml) |
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