-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2312 - Export of ambiguous monomers doesn't work (error appears) to …
…any export format (even to SVG/PNG) except KET (#2528)
- Loading branch information
1 parent
1b172eb
commit a73614f
Showing
11 changed files
with
637 additions
and
7 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
api/tests/integration/ref/formats/ket_ambiguous_export.py.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Test mol v2000 | ||
molecule: Ambiguous monomer cannot be transform to SGroup. | ||
Test mol v3000 | ||
molfile saver: Ambiguous monomer cannot be saved to molfile. | ||
Test cdxml | ||
molecule: Ambiguous monomer cannot be transform to SGroup. | ||
Test cml | ||
molecule: Ambiguous monomer cannot be transform to SGroup. | ||
Test smiles | ||
* |
53 changes: 53 additions & 0 deletions
53
api/tests/integration/tests/formats/ket_ambiguous_export.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import difflib | ||
import os | ||
import sys | ||
|
||
|
||
def find_diff(a, b): | ||
return "\n".join(difflib.unified_diff(a.splitlines(), b.splitlines())) | ||
|
||
|
||
sys.path.append( | ||
os.path.normpath( | ||
os.path.join(os.path.abspath(__file__), "..", "..", "..", "common") | ||
) | ||
) | ||
from env_indigo import ( # noqa | ||
Indigo, | ||
IndigoException, | ||
getIndigoExceptionText, | ||
joinPathPy, | ||
) | ||
|
||
indigo = Indigo() | ||
|
||
root = joinPathPy("molecules/macro/", __file__) | ||
|
||
mol = indigo.loadMoleculeFromFile(os.path.join(root, "ambiguous.ket")) | ||
print("Test mol v2000") | ||
try: | ||
indigo.setOption("molfile-saving-mode", "2000") | ||
print(mol.molfile()) | ||
except IndigoException as e: | ||
print(getIndigoExceptionText(e)) | ||
print("Test mol v3000") | ||
try: | ||
indigo.setOption("molfile-saving-mode", "3000") | ||
print(mol.molfile()) | ||
except IndigoException as e: | ||
print(getIndigoExceptionText(e)) | ||
print("Test cdxml") | ||
try: | ||
print(mol.cdxml()) | ||
except IndigoException as e: | ||
print(getIndigoExceptionText(e)) | ||
print("Test cml") | ||
try: | ||
print(mol.cml()) | ||
except IndigoException as e: | ||
print(getIndigoExceptionText(e)) | ||
print("Test smiles") | ||
try: | ||
print(mol.smiles()) | ||
except IndigoException as e: | ||
print(getIndigoExceptionText(e)) |
Oops, something went wrong.