Skip to content

Commit fb1f8b1

Browse files
committed
Test for specific error message
1 parent 89edbdb commit fb1f8b1

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed
Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
22
from helpers import parse_inchi_from_executable_output
33

4+
45
@pytest.fixture
56
def molfile_Cyclopentadiene_anion():
67
return """
@@ -12,18 +13,19 @@ def molfile_Cyclopentadiene_anion():
1213
0.1498 -0.6674 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1314
0.6348 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1415
0.1498 0.6674 0.0000 C 0 5 0 0 0 0 0 0 0 0 0 0
15-
1 2 4 0
16-
2 3 4 0
17-
3 4 4 0
18-
4 5 4 0
19-
5 1 4 0
16+
1 2 4 0
17+
2 3 4 0
18+
3 4 4 0
19+
4 5 4 0
20+
5 1 4 0
2021
M CHG 1 5 -1
2122
M END
2223
"""
2324

25+
2426
@pytest.fixture
2527
def molfile_Cycloheptatriene_cation():
26-
return """
28+
return """
2729
ChemDraw02042509542D
2830
2931
7 7 0 0 0 0 0 0 0 0999 V2000
@@ -34,53 +36,61 @@ def molfile_Cycloheptatriene_cation():
3436
0.9036 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
3537
0.5457 0.7433 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
3638
-0.2586 0.9269 0.0000 C 0 3 0 0 0 0 0 0 0 0 0 0
37-
1 2 4 0
38-
2 3 4 0
39-
3 4 4 0
40-
4 5 4 0
41-
5 6 4 0
42-
6 7 4 0
43-
7 1 4 0
39+
1 2 4 0
40+
2 3 4 0
41+
3 4 4 0
42+
4 5 4 0
43+
5 6 4 0
44+
6 7 4 0
45+
7 1 4 0
4446
M CHG 1 7 1
4547
M END
4648
"""
4749

50+
4851
@pytest.fixture
4952
def molfile_Cyclopropene_cation():
50-
return """
53+
return """
5154
ChemDraw02042509402D
5255
5356
3 3 0 0 0 0 0 0 0 0999 V2000
5457
-0.3572 0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
5558
-0.3572 -0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
5659
0.3572 0.0000 0.0000 C 0 3 0 0 0 0 0 0 0 0 0 0
57-
1 2 4 0
58-
2 3 4 0
59-
3 1 4 0
60+
1 2 4 0
61+
2 3 4 0
62+
3 1 4 0
6063
M CHG 1 3 1
6164
M END
6265
"""
6366

67+
6468
@pytest.mark.xfail(strict=True, raises=AssertionError)
6569
def test_Cyclopentadiene_anion(molfile_Cyclopentadiene_anion, run_inchi_exe):
6670
result = run_inchi_exe(molfile_Cyclopentadiene_anion)
67-
assert (
68-
"InChI=1S/C5H5/c1-2-4-5-3-1/h1-5H/q-1"
69-
== parse_inchi_from_executable_output(result.output)
71+
72+
assert "Error -9986 (Cannot process aromatic bonds)" not in result.stderr
73+
assert "InChI=1S/C5H5/c1-2-4-5-3-1/h1-5H/q-1" == parse_inchi_from_executable_output(
74+
result.output
7075
)
7176

77+
7278
@pytest.mark.xfail(strict=True, raises=AssertionError)
7379
def test_Cycloheptatriene_cation(molfile_Cycloheptatriene_cation, run_inchi_exe):
7480
result = run_inchi_exe(molfile_Cycloheptatriene_cation)
81+
82+
assert "Error -9986 (Cannot process aromatic bonds)" not in result.stderr
7583
assert (
7684
"InChI=1S/C7H7/c1-2-4-6-7-5-3-1/h1-7H/q+1"
7785
== parse_inchi_from_executable_output(result.output)
7886
)
7987

88+
8089
@pytest.mark.xfail(strict=True, raises=AssertionError)
8190
def test_Cyclopropene_cation(molfile_Cyclopropene_cation, run_inchi_exe):
8291
result = run_inchi_exe(molfile_Cyclopropene_cation)
83-
assert (
84-
"InChI=1S/C3H3/c1-2-3-1/h1-3H/q+1"
85-
== parse_inchi_from_executable_output(result.output)
92+
93+
assert "Error -9986 (Cannot process aromatic bonds)" not in result.stderr
94+
assert "InChI=1S/C3H3/c1-2-3-1/h1-3H/q+1" == parse_inchi_from_executable_output(
95+
result.output
8696
)

0 commit comments

Comments
 (0)