def test_from_metwork_v0(): tsf = Transformation.from_metwork_v0( "[#6:1](=,:[#8:2])(-[#6:3])-[#6:4]>>[#6:4]-[#6:1](-[#8:2]-[H])(-[H])-[#6:3]" ) assert (tsf.smarts == "[#6:1](=[#8:2])(-[#6:3])-[#6:4]>>[#6:3]-[#6:1](-[#8:2])-[#6:4]") tsf = Transformation.from_metwork_v0( "[#6:1](-[#7:2]-[H:3])-[#6:4]-[#6:5]>>[#7:2](-[#6:3]1-[#6](-[#6](-[#6](-[#6](-[#8]-1)-[#6](=,:[#8])-[#8])-[#8])-[#8])-[#8])-[#6:1]-[#6:4]-[#6:5]" ) assert ( tsf.smarts == "[#6:3](-[#7:1]-[#1:2])-[#6:4]-[#6:5]>>[#7:1](-[#6:2]1(-[#6](-[#6](-[#6](-[#6](-[#8]-1)-[#6](=[#8])-[#8])-[#8])-[#8])-[#8])-[H])-[#6:3]-[#6:4]-[#6:5]" )
def test_simplify_keep_cycles(smarts_metwork, smarts_simplified): tsf = Transformation.from_metwork_v0(smarts_metwork) assert tsf.simplify(cycles=True)[0].smarts == smarts_simplified
def test_simplify_keep_bond_diff(smarts_metwork, smarts_simplified): tsf = Transformation.from_metwork_v0(smarts_metwork) assert tsf.simplify()[0].smarts == smarts_simplified