test_topology_utilities
Tests for topology utility functions including CGenFF topology parsing and mol2 generation.
attributecgenff_dir= settings.cgenff_dirattributecgenff_available= cgenff_dir.exists() and (cgenff_dir / 'cgenff' / 'cgenff_batch.sh').exists()attributeMOL2_REFERENCES= Path(__file__).parent / 'testfiles' / 'mol2_references.json'func_load_mol2_references()Returns
Nonefunc_extract_atom_types(mol2_str)Extract Sybyl atom types from a mol2 string.
parammol2_strReturns
Nonefunc_extract_bond_types(mol2_str)Extract Tripos bond types from a mol2 string.
parammol2_strReturns
Nonefunc_mol2_reference_ids(*, lipids_only=False, exclude_lipids=False)Return list of (name, smiles, ref_mol2) from mol2_references.json.
paramlipids_only= Falseparamexclude_lipids= FalseReturns
Nonefunc_assert_mol2_matches_reference(tmp_path, name, smiles, ref_mol2)Shared assertion logic for mol2 reference tests.
paramtmp_pathparamnameparamsmilesparamref_mol2Returns
Nonefunctest_write_mol2_from_rdkit(tmp_path, name, smiles, ref_mol2)Test mol2 writer against 30 hand-picked reference molecules.
paramtmp_pathparamnameparamsmilesparamref_mol2Returns
Nonefunctest_write_mol2_from_rdkit_lipids(tmp_path, name, smiles, ref_mol2)Test mol2 writer against ~100 diverse lipids. Use pytest -m slow -n auto.
paramtmp_pathparamnameparamsmilesparamref_mol2Returns
Nonefunctest_write_mol2_from_rdkit_no_conformer(tmp_path)Test that write_mol2_from_rdkit raises ValueError when molecule has no conformers.
paramtmp_pathReturns
Nonefunctest_extract_reusable_parts_from_cgenff_gmx_top(tmp_path)paramtmp_pathReturns
Nonefunctest_count_contiguous_strings()Returns
Nonefunctest_run_cgenff_to_gmx(tmp_path)paramtmp_pathReturns
Nonefunctest_sybyl_atom_types_positional()Test _get_sybyl_atom_type positionally on small hand-built molecules.
Returns
Nonefunctest_oco2_carboxylate_partner()Test that both oxygens in a carboxylate get O.co2.
The charged oxygen matches via formal charge, the neutral one via partner logic.
Returns
None