MCPcopy Create free account
hub / github.com/SINGROUP/dscribe / test_exceptions

Function test_exceptions

tests/test_acsf.py:135–161  ·  view source on GitHub ↗

Tests different invalid parameters that should raise an exception.

()

Source from the content-addressed store, hash-verified

133# =============================================================================
134# Tests that are specific to this descriptor.
135def test_exceptions():
136 """Tests different invalid parameters that should raise an
137 exception.
138 """
139 # Invalid species
140 with pytest.raises(ValueError):
141 ACSF(r_cut=6.0, species=None)
142
143 # Invalid bond_params
144 with pytest.raises(ValueError):
145 ACSF(r_cut=6.0, species=[1, 6, 8], g2_params=[1, 2, 3])
146
147 # Invalid bond_cos_params
148 with pytest.raises(ValueError):
149 ACSF(r_cut=6.0, species=[1, 6, 8], g3_params=[[1, 2], [3, 1]])
150
151 # Invalid bond_cos_params
152 with pytest.raises(ValueError):
153 ACSF(r_cut=6.0, species=[1, 6, 8], g3_params=[[1, 2, 4], [3, 1]])
154
155 # Invalid ang4_params
156 with pytest.raises(ValueError):
157 ACSF(r_cut=6.0, species=[1, 6, 8], g4_params=[[1, 2], [3, 1]])
158
159 # Invalid ang5_params
160 with pytest.raises(ValueError):
161 ACSF(r_cut=6.0, species=[1, 6, 8], g5_params=[[1, 2], [3, 1]])
162
163
164def test_features():

Callers

nothing calls this directly

Calls 1

ACSFClass · 0.90

Tested by

no test coverage detected