-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.py
31 lines (19 loc) · 947 Bytes
/
test.py
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
30
31
def test_valid(cldf_dataset, cldf_logger):
assert cldf_dataset.validate(log=cldf_logger)
# Two hundred and forty six (246) basic vocabulary items [19,20] were extracted from
# each of 14 living and one (1) ancient Koreanic variants u
def test_forms(cldf_dataset, cldf_logger):
assert len(list(cldf_dataset['FormTable'])) == 2365
assert len([
f for f in cldf_dataset['FormTable'] if f['Value'] == 'naŋ-kʰi/na-mu'
]) == 2
def test_languages(cldf_dataset, cldf_logger):
assert len(list(cldf_dataset['LanguageTable'])) == 15
def test_sources(cldf_dataset, cldf_logger):
assert len(cldf_dataset.sources) == 4
def test_parameters(cldf_dataset, cldf_logger):
assert len(list(cldf_dataset['ParameterTable'])) == 246
# "The result was a 15 by 383 matrix"
def test_cognates(cldf_dataset, cldf_logger):
cogsets = {c['Cognateset_ID'] for c in cldf_dataset['CognateTable']}
assert len(cogsets) == 383