Skip to content

Commit 82239a1

Browse files
committed
Unit test for maximumSurfaceBondOrder species constraint.
1 parent f8fdf43 commit 82239a1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

rmgpy/constraintsTest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def setUpClass(cls):
6262
maximumSiliconAtoms=1,
6363
maximumSulfurAtoms=1,
6464
maximumSurfaceSites=2,
65+
maximumSurfaceBondOrder=3,
6566
maximumHeavyAtoms=3,
6667
maximumRadicalElectrons=2,
6768
maximumSingletCarbenes=1,
@@ -211,6 +212,16 @@ def test_surface_site_constraint(self):
211212
self.rmg.species_constraints['maximumCarbonAtoms'] = max_carbon
212213
self.rmg.species_constraints['maximumHeavyAtoms'] = max_heavy_atoms
213214

215+
def test_surface_bond_order_constraint(self):
216+
"""
217+
Test that we can constrain the max bond order of surface sites.
218+
"""
219+
mol_1site = Molecule().from_adjacency_list("""
220+
1 C u0 p0 c0 {2,Q}
221+
2 X u0 p0 c0 {2,Q}
222+
""")
223+
self.assertTrue(fails_species_constraints(mol_1site))
224+
214225
def test_heavy_constraint(self):
215226
"""
216227
Test that we can constrain the max number of heavy atoms.

0 commit comments

Comments
 (0)