-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Use chunks when batch writing identity overrides (#3143)
- Loading branch information
Showing
4 changed files
with
97 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
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from util.util import iter_paired_chunks | ||
|
||
|
||
def test__iter_paired_chunks__empty(): | ||
assert list(iter_paired_chunks([], [], chunk_size=1)) == [] | ||
|
||
|
||
def test__iter_paired_chunks__first_empty(): | ||
assert list(iter_paired_chunks([], [1, 2, 3], chunk_size=1)) == [ | ||
([], [1]), | ||
([], [2]), | ||
([], [3]), | ||
] | ||
|
||
|
||
def test__iter_paired_chunks__second_empty(): | ||
assert list(iter_paired_chunks([1, 2, 3], [], chunk_size=1)) == [ | ||
([1], []), | ||
([2], []), | ||
([3], []), | ||
] | ||
|
||
|
||
def test__iter_paired_chunks__first_shorter(): | ||
assert list(iter_paired_chunks([1, 2, 3], [4, 5, 6, 7, 8], chunk_size=3)) == [ | ||
([1, 2], [4]), | ||
([3], [5, 6]), | ||
([], [7, 8]), | ||
] | ||
|
||
|
||
def test__iter_pair_chunks__second_shorter(): | ||
assert list(iter_paired_chunks([1, 2, 3, 4, 5], [6, 7, 8], chunk_size=3)) == [ | ||
([1, 2], [6]), | ||
([3, 4], [7]), | ||
([5], [8]), | ||
] | ||
|
||
|
||
def test__iter_pair_chunks__same_length(): | ||
assert list(iter_paired_chunks([1, 2, 3], [4, 5, 6], chunk_size=3)) == [ | ||
([1, 2], [4]), | ||
([3], [5, 6]), | ||
] |
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