-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_APIs.py
53 lines (37 loc) · 1.39 KB
/
test_APIs.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import APIs
import logging
import general_config as gconf
logger = logging.getLogger(gconf.Logs.LOGGER_NAME)
sample_data_template = {
"things": dict(),
"users": dict(),
"makes": dict()
}
sample_data = sample_data_template.copy()
sample_data['things'] = {"4760325": {"model_name": "Uno Box Holder"},
"4760326": {"model_name": "Pocket hole jig"},
"4760327": {"model_name": "brick"},
"4760328": {"model_name": "Bricks"},
"4760329": {"model_name": "maya"},
"4760330": {"model_name": "Finally done with this test :)"}}
def test_enrich_things_with_google_ktree_sample_run():
data = sample_data["things"].copy()
print(len(data))
def test_enrich_things_with_google_ktree_len_conservation():
data = sample_data["things"].copy()
L = len(data)
APIs.enrich_things_with_google_ktree(data)
L_new = len(data)
assert L == L_new
def test_query_google_ktree_res_type():
data = APIs.query_google_ktree('maya', 5)
assert type(data) == list
def test_query_google_ktree_res_len():
data = APIs.query_google_ktree('maya', 5)
assert len(data) <= 5
def test_query_google_ktree_has_dicts():
data = APIs.query_google_ktree('maya', 5)
for sub in data:
assert type(sub) == dict
def test_parse_data_from_ktree_list():
pass