Skip to content

Commit 7aceb53

Browse files
author
Jason Munro
authored
Fix material rester tests (#760)
* Fix material tests * Add back excluded elements query * Fix excluded elements test * Revert exclude elements inclusion * Limit numeric queries * Exclude nelements * Fix excluded fields * Add density to exluded params * Add excluded params to summary * Add total energy to exluded parameters * More parameters
1 parent dd9c5db commit 7aceb53

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

tests/test_materials.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def rester():
1919
"num_chunks",
2020
"all_fields",
2121
"fields",
22-
"exclude_elements", # temp until timeout update
22+
"exclude_elements", # temp until server timeout increase
23+
"num_elements", # temp until server timeout increase
24+
"num_sites", # temp until server timeout increase
25+
"density", # temp until server timeout increase
2326
]
2427

2528
sub_doc_fields = [] # type: list
@@ -65,14 +68,14 @@ def test_client(rester):
6568
if param_type == typing.Tuple[int, int]:
6669
project_field = alt_name_dict.get(param, None)
6770
q = {
68-
param: (-100, 100),
71+
param: (-10, 10),
6972
"chunk_size": 1,
7073
"num_chunks": 1,
7174
}
7275
elif param_type == typing.Tuple[float, float]:
7376
project_field = alt_name_dict.get(param, None)
7477
q = {
75-
param: (-100.12, 100.12),
78+
param: (-10.12, 10.12),
7679
"chunk_size": 1,
7780
"num_chunks": 1,
7881
}
@@ -92,6 +95,7 @@ def test_client(rester):
9295
}
9396

9497
doc = search_method(**q)[0].dict()
98+
9599
for sub_field in sub_doc_fields:
96100
if sub_field in doc:
97101
doc = doc[sub_field]

tests/test_summary.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
"all_fields",
1515
"fields",
1616
"equilibrium_reaction_energy", # temp until data update
17+
"total_energy", # temp until data update
1718
"exclude_elements", # temp until data update
19+
"num_elements", # temp until server timeout increase
20+
"num_sites", # temp until server timeout increase
21+
"density", # temp until server timeout increase
22+
"total_magnetization", # temp until server timeout increase
1823
]
1924

2025
alt_name_dict = {
@@ -79,14 +84,14 @@ def test_client():
7984
elif param_type == typing.Tuple[int, int]:
8085
project_field = alt_name_dict.get(param, None)
8186
q = {
82-
param: (-100, 100),
87+
param: (-10, 10),
8388
"chunk_size": 1,
8489
"num_chunks": 1,
8590
}
8691
elif param_type == typing.Tuple[float, float]:
8792
project_field = alt_name_dict.get(param, None)
8893
q = {
89-
param: (-100.12, 100.12),
94+
param: (-10.12, 10.12),
9095
"chunk_size": 1,
9196
"num_chunks": 1,
9297
}

0 commit comments

Comments
 (0)