Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 45d308e

Browse files
committedNov 2, 2024··
add unit test
1 parent 6f7be68 commit 45d308e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎tests/analysis/test_local_env.py

+13
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
from pymatgen.analysis.graphs import MoleculeGraph, StructureGraph
1313
from pymatgen.analysis.local_env import (
14+
CN_OPT_PARAMS,
15+
DEFAULT_OP_PARAMS,
1416
BrunnerNNReal,
1517
BrunnerNNReciprocal,
1618
BrunnerNNRelative,
@@ -29,6 +31,8 @@
2931
OpenBabelNN,
3032
ValenceIonicRadiusEvaluator,
3133
VoronoiNN,
34+
cn_opt_params,
35+
default_op_params,
3236
get_neighbors_of_site_with_index,
3337
metal_edge_extender,
3438
on_disorder_options,
@@ -42,6 +46,15 @@
4246
TEST_DIR = f"{TEST_FILES_DIR}/analysis/local_env/fragmenter_files"
4347

4448

49+
def test_opt_params():
50+
assert isinstance(default_op_params, dict)
51+
assert default_op_params == DEFAULT_OP_PARAMS
52+
53+
assert isinstance(cn_opt_params, dict)
54+
assert list(cn_opt_params.keys()) == [2, 3, 4, 5, 6, 7, 8, 12]
55+
assert cn_opt_params == CN_OPT_PARAMS
56+
57+
4558
class TestValenceIonicRadiusEvaluator(PymatgenTest):
4659
def setUp(self):
4760
"""Setup MgO rocksalt structure for testing Vacancy."""

0 commit comments

Comments
 (0)