-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic unit testing for util functions
- Loading branch information
Oscar
committed
Mar 3, 2025
1 parent
2350f36
commit 906b282
Showing
1 changed file
with
25 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from moto.dynamodb.utils import find_duplicates, find_path_overlaps | ||
|
||
|
||
def test_find_duplicates_simple_duplicate(): | ||
assert find_duplicates(["a", "a"]) == ["a", "a"] | ||
|
||
|
||
def test_find_duplicates_no_duplicates(): | ||
assert find_duplicates(["a", "b"]) == [] | ||
|
||
|
||
def test_find_duplicates_out_of_order(): | ||
assert find_duplicates(["b", "a", "b"]) == ["b", "b"] | ||
|
||
|
||
def test_find_path_overlaps_simple_overlap(): | ||
assert find_path_overlaps(["a", "a.b"]) == ["a", "a.b"] | ||
|
||
|
||
def test_find_path_overlaps_no_overlap(): | ||
assert find_path_overlaps(["a", "b"]) == [] | ||
|
||
|
||
def test_find_path_overlaps_reverse_overlap(): | ||
assert find_path_overlaps(["a.b", "a"]) == ["a.b", "a"] |