Skip to content

Commit bdbf5e8

Browse files
kirkbadger18JacksonBurns
authored andcommitted
added a test for drawing bidentates with charge separation
1 parent 0ad2bb7 commit bdbf5e8

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

test/rmgpy/molecule/drawTest.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,4 +297,21 @@ def test_draw_bidentate_adsorbate(self):
297297
surface, _cr, (_xoff, _yoff, width, height) = self.drawer.draw(molecule, file_format="png", target=path)
298298
assert os.path.exists(path), "File doesn't exist"
299299
os.unlink(path)
300-
assert isinstance(surface, ImageSurface)
300+
assert isinstance(surface, ImageSurface)
301+
302+
def test_draw_bidentate_with_charge_separation(self):
303+
molecule = Molecule().from_adjacency_list(
304+
"""
305+
1 X u0 p0 c0 {3,S}
306+
2 X u0 p0 c0 {4,D}
307+
3 O u0 p2 c0 {1,S} {4,S}
308+
4 N u0 p0 c+1 {3,S} {2,D} {5,S}
309+
5 O u0 p3 c-1 {4,S}
310+
"""
311+
)
312+
try:
313+
from cairocffi import PDFSurface
314+
except ImportError:
315+
from cairo import PDFSurface
316+
surface, _cr, (_xoff, _yoff, _width, _height) = self.drawer.draw(molecule, file_format="pdf")
317+
assert isinstance(surface, PDFSurface)

0 commit comments

Comments
 (0)