-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
4 changed files
with
27 additions
and
3 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
23 changes: 23 additions & 0 deletions
23
airbyte-integrations/connectors/source-hubspot/unit_tests/test_split_properties.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,23 @@ | ||
# | ||
# Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
# | ||
|
||
import pytest | ||
from source_hubspot.streams import split_properties | ||
|
||
lorem_ipsum = """Lorem ipsum dolor sit amet, consectetur adipiscing elit""" | ||
lorem_ipsum = lorem_ipsum.lower().replace(",", "") | ||
|
||
many_properties = lorem_ipsum.split(" ") * 100 | ||
few_properties = ["firstname", "lastname", "age", "dob", "id"] | ||
|
||
|
||
@pytest.mark.parametrize(("properties", "chunks_expected"), ((few_properties, 1), (many_properties, 2))) | ||
def test_split_properties(properties, chunks_expected): | ||
chunked_properties = set() | ||
index = 0 | ||
for index, chunk in enumerate(split_properties(properties)): | ||
chunked_properties |= set(chunk) | ||
chunks = index + 1 | ||
assert chunked_properties == set(properties) | ||
assert chunks == chunks_expected |
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