1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/usr/bin/env python3
import server as s
def test_drop_dup():
sample = [
{"document": "Hello", "metadata": 5},
{"document": "World", "metadata": 8},
{"document": "Hello", "metadata": 6},
{"document": "Good", "metadata": 3},
{"document": "World", "metadata": 9},
{"document": "World\n\n", "metadata": 9},
]
assert s.drop_duplicates(sample) == (["Hello", "World", "Good"], [5, 8, 3])
|