File: test_dynamodb_utils.py

package info (click to toggle)
python-moto 5.1.18-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 116,520 kB
  • sloc: python: 636,725; javascript: 181; makefile: 39; sh: 3
file content (25 lines) | stat: -rw-r--r-- 667 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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"]