Skip to content

Commit c9888c2

Browse files
authored
Add test for reactions with dative bonds (#53)
1 parent 79260a1 commit c9888c2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_mapper.py

+13
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,16 @@ def test_multiple_products(rxn_mapper: RXNMapper):
108108

109109
results = rxn_mapper.get_attention_guided_atom_maps(rxns)
110110
assert_correct_maps(results, expected)
111+
112+
113+
def test_reaction_with_dative_bond(rxn_mapper: RXNMapper):
114+
rxns = ["COC(=O)CCBr.O=C[O-]->[K+]>>COC(=O)CCOC(=O)C"]
115+
expected = [
116+
{
117+
"mapped_rxn": "[CH3:1][O:2][C:3](=[O:4])[CH2:5][CH2:6]Br.[O:9]=[CH:8][O-:7]->[K+]>>[CH3:1][O:2][C:3](=[O:4])[CH2:5][CH2:6][O:7][C:8](=[O:9])[CH3:10]",
118+
"confidence": 0.9322116305783666,
119+
}
120+
]
121+
122+
results = rxn_mapper.get_attention_guided_atom_maps(rxns, canonicalize_rxns=False)
123+
assert_correct_maps(results, expected)

0 commit comments

Comments
 (0)