Skip to content

Commit

Permalink
Basic unit testing for util functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar committed Mar 3, 2025
1 parent 2350f36 commit 906b282
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_dynamodb/test_dynamodb_utils.py
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"]

0 comments on commit 906b282

Please sign in to comment.