[7fc5df]: / tests / surrogates / generators / test_age.py

Download this file

30 lines (26 with data), 602 Bytes

 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
26
27
28
29
from deidentify.surrogates.generators import AgeSurrogates
def test_replace_one():
annotations = [
'88 jarige',
'24/25e',
'2',
'60',
'patient is 92',
'91 age',
'90 jaar oud',
'89 years',
'101'
]
age_surrogates = AgeSurrogates(annotations=annotations)
annotations_replaced = age_surrogates.replace_all()
assert annotations_replaced == [
'88 jarige',
'24/25e',
'2',
'60',
'patient is 89',
'89 age',
'89 jaar oud',
'89 years',
'89'
]