tests package

Submodules

tests.conftest module

tests.conftest.Ni_def2tzvp_PCHOSi_svp_text_file(txt_path)[source]
tests.conftest.Ni_def2tzvp_PCHOSi_svp_txt_file(txt_path)[source]
tests.conftest.acetylene_molecule()[source]

C₂H₂ – contains a C≡C triple bond.

tests.conftest.blank_element_pdb_file(tmpdir)[source]

PDB file where element columns (77-78) are blank, requiring inference.

tests.conftest.capture_log(caplog)[source]

Fixture to capture log messages.

Captures messages from the root logger at DEBUG level by default.

tests.conftest.chemdraw_directory(structure_test_directory)[source]
tests.conftest.chemdraw_expected_directory(chemdraw_directory)[source]
tests.conftest.chemsmart_generated_xyz_file(xyz_directory)[source]
tests.conftest.chemsmart_templates_config(mocker)[source]

Point USER_CONFIG_DIR to the local templates directory. This avoids creating a mock directory and instead uses the provided templates.

tests.conftest.chiral_molecule()[source]

Molecule with a chiral center (C with 4 different substituents).

tests.conftest.co2_molecule()[source]

CO₂ – linear molecule with two C=O double bonds.

tests.conftest.complex_molecule_cdxml_file(chemdraw_directory)[source]
tests.conftest.conformers_from_rdkit()[source]

Generate multiple conformers for a complex molecule using RDKit.

tests.conftest.constrained_atoms()[source]

Fixture to create a simple Ar2 dimer with constraints.

tests.conftest.constrained_pbc_db_file(io_test_directory)[source]

Fixture of a .db file containing constrained PBC database from heterogeneous catalysis.

tests.conftest.cube_test_directory(gaussian_test_directory)[source]
tests.conftest.cxsmiles_expected_large_c2_file(cxsmiles_test_directory)[source]
tests.conftest.cxsmiles_expected_large_c3_file(cxsmiles_test_directory)[source]
tests.conftest.cxsmiles_large_molecule_c2_file(cxsmiles_test_directory)[source]
tests.conftest.cxsmiles_large_molecule_c3_file(cxsmiles_test_directory)[source]
tests.conftest.cxsmiles_normal_file(cxsmiles_test_directory)[source]
tests.conftest.cxsmiles_r_enantiomer_file(cxsmiles_test_directory)[source]
tests.conftest.cxsmiles_r_rotamer_file(cxsmiles_test_directory)[source]
tests.conftest.cxsmiles_s_enantiomer_file(cxsmiles_test_directory)[source]
tests.conftest.cxsmiles_s_rotamer_file(cxsmiles_test_directory)[source]
tests.conftest.cxsmiles_test_directory(structure_test_directory)[source]
tests.conftest.dlpno_ccsdt_sp_full_print(orca_outputs_directory)[source]
tests.conftest.dna_hybrid_visualized_xyz_file(xyz_directory)[source]
tests.conftest.dummy_yaml_file()[source]
tests.conftest.empty_pdb_file(tmpdir)[source]

PDB file with no ATOM/HETATM records.

tests.conftest.esp_cube_file(cube_test_directory)[source]
tests.conftest.ethanol_molecule()[source]
tests.conftest.ethylene_molecule()[source]

C₂H₄ – contains a C=C double bond.

tests.conftest.excel_file(io_test_directory)[source]
tests.conftest.expected_benzene_com(chemdraw_expected_directory)[source]
tests.conftest.expected_benzene_xyz(chemdraw_expected_directory)[source]
tests.conftest.expected_complex_molecule_com(chemdraw_expected_directory)[source]
tests.conftest.expected_imidazole_xyz(chemdraw_expected_directory)[source]
tests.conftest.expected_methane_com(chemdraw_expected_directory)[source]
tests.conftest.expected_methane_xyz(chemdraw_expected_directory)[source]
tests.conftest.expected_two_molecules_1_com(chemdraw_expected_directory)[source]
tests.conftest.expected_two_molecules_1_xyz(chemdraw_expected_directory)[source]
tests.conftest.expected_two_molecules_2_com(chemdraw_expected_directory)[source]
tests.conftest.expected_two_molecules_2_xyz(chemdraw_expected_directory)[source]
tests.conftest.extended_xyz_file(xyz_directory)[source]
tests.conftest.fake_iterate_jobrunner(pbs_server)[source]
tests.conftest.fe2_quintet_output(orca_outputs_directory)[source]
tests.conftest.fe2_singlet_output(orca_outputs_directory)[source]
tests.conftest.fe2_triplet_output(orca_outputs_directory)[source]
tests.conftest.fe3_doublet_output(orca_outputs_directory)[source]
tests.conftest.fe3_quartet_output(orca_outputs_directory)[source]
tests.conftest.fe3_sextet_output(orca_outputs_directory)[source]
tests.conftest.gaussian_acetone_opt_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_benzene_opt_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_boltzmann_test_directory(gaussian_test_directory)[source]
tests.conftest.gaussian_co2_opt_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_co2_pressure1p5_outfile(gaussian_thermochem_test_directory)[source]
tests.conftest.gaussian_co2_pressure3_outfile(gaussian_thermochem_test_directory)[source]
tests.conftest.gaussian_conformer1_outfile(gaussian_boltzmann_test_directory)[source]
tests.conftest.gaussian_conformer2_outfile(gaussian_boltzmann_test_directory)[source]
tests.conftest.gaussian_failed_modred_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_failed_scan_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_frozen_opt_inputfile(gaussian_inputs_test_directory)[source]
tests.conftest.gaussian_frozen_opt_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_he_opt_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_hirshfeld_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_inputs_genecp_directory(gaussian_inputs_test_directory)[source]
tests.conftest.gaussian_inputs_test_directory(gaussian_test_directory)[source]
tests.conftest.gaussian_jobrunner_no_scratch(pbs_server)[source]
tests.conftest.gaussian_jobrunner_scratch(tmpdir, pbs_server)[source]
tests.conftest.gaussian_modred_inputfile(gaussian_inputs_test_directory)[source]
tests.conftest.gaussian_modred_with_custom_basis_for_all_atoms_from_api(gaussian_written_files_directory)[source]
tests.conftest.gaussian_mp2_outputfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_oniom_outputfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_opt_genecp_inputfile(gaussian_inputs_genecp_directory)[source]
tests.conftest.gaussian_opt_inputfile(gaussian_inputs_test_directory)[source]
tests.conftest.gaussian_outputs_test_directory(gaussian_test_directory)[source]
tests.conftest.gaussian_ozone_opt_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_pbc_1d_inputfile(gaussian_pbc_inputs_test_directory)[source]
tests.conftest.gaussian_pbc_2d_outputfile(gaussian_pbc_outputs_test_directory)[source]
tests.conftest.gaussian_pbc_3d_outputfile(gaussian_pbc_outputs_test_directory)[source]
tests.conftest.gaussian_pbc_inputs_test_directory(gaussian_pbc_test_directory)[source]
tests.conftest.gaussian_pbc_outputs_test_directory(gaussian_pbc_test_directory)[source]
tests.conftest.gaussian_pbc_test_directory(gaussian_test_directory)[source]
tests.conftest.gaussian_pd_insertion_ts_r_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_qmmm_input_test_directory(gaussian_inputs_test_directory)[source]
tests.conftest.gaussian_qmmm_inputfile_2layer(gaussian_qmmm_input_test_directory)[source]
tests.conftest.gaussian_qmmm_inputfile_3layer(gaussian_qmmm_input_test_directory)[source]
tests.conftest.gaussian_quintet_opt_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_rc_hirshfeld_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_scan_inputfile(gaussian_inputs_test_directory)[source]
tests.conftest.gaussian_semiempirical_pm6_output_file(gaussian_semiempirical_test_directory)[source]
tests.conftest.gaussian_semiempirical_test_directory(gaussian_test_directory)[source]
tests.conftest.gaussian_singlet_opt_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_test_directory(test_data_directory)[source]
tests.conftest.gaussian_thermochem_test_directory(gaussian_test_directory)[source]
tests.conftest.gaussian_triplet_opt_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_ts_genecp_outfile(gaussian_outputs_test_directory)[source]
tests.conftest.gaussian_written_files_directory(gaussian_test_directory)[source]
tests.conftest.gaussian_written_modred_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_opt_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_opt_file_with_route(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_opt_from_graphite_2d_pbc_log(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_pm6_opt_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_qmmm_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_qmmm_log_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_scan_multiple_degrees_of_freedom_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_scan_multiple_degrees_of_freedom_with_constraints_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_scan_single_degree_of_freedom_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_sp_from_nhc_singlet_log_with_custom_basis_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_sp_from_nhc_singlet_log_with_custom_basis_from_api_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_sp_from_nhc_singlet_log_with_custom_basis_from_api_file_v2(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_sp_from_nhc_singlet_log_with_custom_solvent_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_sp_from_nhc_singlet_log_with_solvent_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_ts_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_written_ts_from_nhc_singlet_log_file(gaussian_written_files_directory)[source]
tests.conftest.gaussian_yaml_settings_defaults(gaussian_yaml_settings_directory)[source]
tests.conftest.gaussian_yaml_settings_directory(gaussian_test_directory)[source]
tests.conftest.gaussian_yaml_settings_gas_solv(gaussian_yaml_settings_directory)[source]
tests.conftest.gaussian_yaml_settings_gas_solv_project_name(gaussian_yaml_settings_directory)[source]
tests.conftest.gaussian_yaml_settings_qmmm(gaussian_yaml_settings_directory)[source]
tests.conftest.gaussian_yaml_settings_qmmm_project_name(gaussian_yaml_settings_directory)[source]
tests.conftest.gaussian_yaml_settings_solv(gaussian_yaml_settings_directory)[source]
tests.conftest.gen_text_file_from_web(text_directory)[source]
tests.conftest.gen_txt_file_from_web(txt_path)[source]
tests.conftest.genecp_text_file_from_web(text_directory)[source]
tests.conftest.genecp_txt_file_from_web(txt_path)[source]
tests.conftest.gtoint_errfile(orca_errors_directory)[source]
tests.conftest.hf_com_filepath(gaussian_inputs_test_directory)[source]
tests.conftest.hirshfeld_full_print(orca_outputs_directory)[source]
tests.conftest.hydrogen_molecule()[source]

H₂ – minimal molecule with H-H bond.

tests.conftest.inchikey_large_molecule_c2_file(inchikey_test_directory)[source]
tests.conftest.inchikey_large_molecule_c3_file(inchikey_test_directory)[source]
tests.conftest.inchikey_normal_file(inchikey_test_directory)[source]
tests.conftest.inchikey_r_enantiomer_file(inchikey_test_directory)[source]
tests.conftest.inchikey_s_enantiomer_file(inchikey_test_directory)[source]
tests.conftest.inchikey_test_directory(structure_test_directory)[source]
tests.conftest.inpfile_path(orca_test_directory)[source]
tests.conftest.invoke_config_server()[source]

Return a callable that invokes ‘chemsmart config server’ via Click’s CliRunner.

Usage in tests:

def test_something(invoke_config_server):
    result = invoke_config_server()
    assert result.exit_code == 0
tests.conftest.invoke_folder_command()[source]

Fixture that returns a callable to invoke a folder command with options.

tests.conftest.invoke_mol_cli()[source]

Invoke mol CLI with provided args.

tests.conftest.invoke_mol_with_visualize()[source]

Invoke mol visualize with all PyMOL job execution mocked out.

tests.conftest.io_test_directory(test_data_directory)[source]
tests.conftest.iterate_configs_directory(iterate_test_directory)[source]

Returns the absolute path to tests/data/IterateTests/configs.

tests.conftest.iterate_expected_output_directory(iterate_test_directory)[source]

Returns the absolute path to tests/data/IterateTests/expected_output.

tests.conftest.iterate_expected_output_file(iterate_expected_output_directory)[source]

Returns the absolute path to tests/data/IterateTests/expected_output/ integration_iterate_SLSQP_lagrange_multipliers_96_6.xyz.

tests.conftest.iterate_input_directory(iterate_test_directory)[source]

Returns the absolute path to tests/data/IterateTests/input.

tests.conftest.iterate_integration_config_file(iterate_configs_directory)[source]

Returns the absolute path to tests/data/IterateTests/configs/integration_iterate.toml.

Returns the absolute path to tests/data/IterateTests/configs/ invalid_skeleton_link_index.toml.

tests.conftest.iterate_jobrunner(pbs_server)[source]
tests.conftest.iterate_template_file(iterate_configs_directory)[source]

Returns the absolute path to tests/data/IterateTests/configs/iterate_template.toml.

tests.conftest.iterate_test_directory(test_data_directory)[source]

Returns the absolute path to tests/data/IterateTests.

tests.conftest.iterate_timeout_config_file(iterate_configs_directory)[source]

Returns the absolute path to tests/data/IterateTests/configs/timeout_iterate.toml.

tests.conftest.make_cli_ctx_obj()[source]

Factory for the minimal Click context object.

tests.conftest.make_thermochemistry_mock()[source]

Factory fixture that creates a MagicMock mimicking a Thermochemistry instance.

Returns a callable that accepts the attributes accessed by Thermochemistry.cleaned_frequencies and returns a properly configured mock, so test methods stay free of direct MagicMock construction.

Usage:

def test_something(make_thermochemistry_mock):
    mock = make_thermochemistry_mock(
        vibrational_frequencies=[-50.0, 100.0],
        jobtype="opt",
        check_imaginary_frequencies=False,
    )
    result = Thermochemistry.cleaned_frequencies.fget(mock)
    assert result == [100.0, 100.0]
tests.conftest.metal_ligand_molecules_cdxml_file(chemdraw_directory)[source]
tests.conftest.methane_molecule()[source]

CH₄ tetrahedral.

tests.conftest.methanol_and_ethanol(methanol_molecule, ethanol_molecule)[source]
tests.conftest.methanol_molecule()[source]
tests.conftest.methanol_molecules(methanol_molecule)[source]
tests.conftest.methyl3hexane_molecule()[source]
tests.conftest.mock_popen(mocker)[source]

Fixture to mock subprocess.Popen.

tests.conftest.modred_gen_inputfile(gaussian_inputs_genecp_directory)[source]
tests.conftest.modred_genecp_custom_solvent_inputfile(gaussian_inputs_genecp_directory)[source]
tests.conftest.modred_genecp_inputfile(gaussian_inputs_genecp_directory)[source]
tests.conftest.multi_model_pdb_file(tmpdir)[source]

PDB file with two explicit MODEL/ENDMDL blocks.

tests.conftest.multi_molecule_cdxml_file(chemdraw_directory)[source]
tests.conftest.multiple_molecules_xyz_file(xyz_directory)[source]
tests.conftest.nciplot_jobrunner_no_scratch(pbs_server)[source]
tests.conftest.nciplot_jobrunner_scratch(tmpdir, pbs_server)[source]
tests.conftest.orca_co2_output(orca_outputs_directory)[source]
tests.conftest.orca_dias_directory(orca_test_directory)[source]
tests.conftest.orca_epr_solv(orca_inputs_directory)[source]
tests.conftest.orca_errors_directory(orca_test_directory)[source]
tests.conftest.orca_faulty_solv(orca_inputs_directory)[source]
tests.conftest.orca_fixed_atoms(orca_outputs_directory)[source]
tests.conftest.orca_fixed_bonds_and_angles(orca_outputs_directory)[source]
tests.conftest.orca_fixed_dihedral(orca_outputs_directory)[source]
tests.conftest.orca_he_output_freq(orca_outputs_directory)[source]
tests.conftest.orca_input_nebts_file(orca_inputs_xyz_directory)[source]

Returns the absolute path to the orca input file for NEB with TS optimization.

tests.conftest.orca_input_nebts_product_xyz_file(orca_inputs_xyz_directory)[source]

Returns the absolute path to the orca input file for NEB with TS optimization.

tests.conftest.orca_input_nebts_reactant_xyz_file(orca_inputs_xyz_directory)[source]

Returns the absolute path to the orca input file for NEB with TS optimization.

tests.conftest.orca_input_nebts_ts_xyz_file(orca_inputs_xyz_directory)[source]

Returns the absolute path to the orca input file for NEB with TS optimization.

tests.conftest.orca_inputs_directory(orca_test_directory)[source]
tests.conftest.orca_inputs_xyz_directory(orca_inputs_directory)[source]

Returns the absolute path to the orca inputs that specifies xyz files.

tests.conftest.orca_jobrunner_no_scratch(pbs_server)[source]
tests.conftest.orca_jobrunner_scratch(tmpdir, pbs_server)[source]
tests.conftest.orca_neb_output_file(orca_outputs_directory)[source]
tests.conftest.orca_outputs_directory(orca_test_directory)[source]
tests.conftest.orca_qmmm_input_file(orca_inputs_directory)[source]
tests.conftest.orca_sn2_ts_output(orca_outputs_directory)[source]
tests.conftest.orca_test_directory(test_data_directory)[source]
tests.conftest.orca_two_layer_qmmmm_output_file(orca_outputs_directory)[source]
tests.conftest.orca_written_files_directory(orca_test_directory)[source]
tests.conftest.orca_written_he_monoatomic_opt_file(orca_written_files_directory)[source]
tests.conftest.orca_written_modred_file(orca_written_files_directory)[source]
tests.conftest.orca_written_neb_file(orca_written_files_directory)[source]
tests.conftest.orca_written_opt_file(orca_written_files_directory)[source]
tests.conftest.orca_written_opt_file_with_route(orca_written_files_directory)[source]
tests.conftest.orca_written_scan_multiple_degrees_of_freedom_file(orca_written_files_directory)[source]
tests.conftest.orca_written_scan_multiple_degrees_of_freedom_with_constraints_file(orca_written_files_directory)[source]
tests.conftest.orca_written_scan_single_degree_of_freedom_file(orca_written_files_directory)[source]
tests.conftest.orca_written_sp_from_nhc_singlet_log_with_solvent_file(orca_written_files_directory)[source]
tests.conftest.orca_written_ts_file(orca_written_files_directory)[source]
tests.conftest.orca_written_ts_from_nhc_singlet_log_file(orca_written_files_directory)[source]
tests.conftest.orca_yaml_settings_custom_solv_cosmors_project_name(orca_yaml_settings_directory)[source]
tests.conftest.orca_yaml_settings_custom_solv_project_name(orca_yaml_settings_directory)[source]
tests.conftest.orca_yaml_settings_defaults(orca_yaml_settings_directory)[source]
tests.conftest.orca_yaml_settings_directory(orca_test_directory)[source]
tests.conftest.orca_yaml_settings_gas_solv(orca_yaml_settings_directory)[source]
tests.conftest.orca_yaml_settings_gas_solv_project_name(orca_yaml_settings_directory)[source]
tests.conftest.orca_yaml_settings_neb_project_name(orca_yaml_settings_directory)[source]
tests.conftest.orca_yaml_settings_orca_project_name(orca_yaml_settings_directory)[source]
tests.conftest.orca_yaml_settings_solv(orca_yaml_settings_directory)[source]
tests.conftest.orca_yaml_settings_solv_project_name(orca_yaml_settings_directory)[source]
tests.conftest.outputs_test_directory(gaussian_test_directory)[source]
tests.conftest.pbs_server(server_yaml_file)[source]
tests.conftest.pymol_align_jobrunner(pbs_server)[source]
tests.conftest.pymol_hybrid_visualization_jobrunner(pbs_server)[source]
tests.conftest.pymol_ircmovie_jobrunner(pbs_server)[source]
tests.conftest.pymol_mo_jobrunner(pbs_server)[source]
tests.conftest.pymol_movie_jobrunner(pbs_server)[source]
tests.conftest.pymol_visualization_jobrunner(pbs_server)[source]
tests.conftest.qmmm_written_xyz_file(gaussian_written_files_directory)[source]
tests.conftest.qmmm_written_xyz_only_file(gaussian_written_files_directory)[source]
tests.conftest.reference_genecp_txt_file_from_api(txt_path)[source]
tests.conftest.run_gaussian_and_capture_settings()[source]

Run the gaussian CLI with a patched job class and capture settings.

tests.conftest.run_orca_and_capture_settings()[source]

Run the orca CLI with a patched job class and capture settings.

tests.conftest.run_thermochemistry_and_capture_settings()[source]

Run the thermochemistry CLI with mocked job construction.

tests.conftest.run_thermochemistry_with_directory()[source]

Fixture to invoke thermochemistry CLI with directory options and mocked folder.

Patches BaseFolder so that get_all_output_files_in_current_folder_by_program, get_all_files_in_current_folder_by_suffix, and get_all_files_in_current_folder_by_program_and_suffix all return the caller-supplied mock_files list. Also patches ThermochemistryJob.from_filename to avoid real job execution.

Usage:

def test_something(run_thermochemistry_with_directory, tmp_path):
    result, mock_from_filename = run_thermochemistry_with_directory(
        ["-d", str(tmp_path), "-p", "gaussian", "-T", "298.15"],
        mock_files=["/fake/a.log", "/fake/b.log"],
    )
    assert result.exit_code == 0
    assert mock_from_filename.call_count == 2
tests.conftest.sdf_file(test_data_directory)[source]
tests.conftest.server_yaml_file(utils_test_directory)[source]
tests.conftest.session_mocker(pytestconfig)[source]

Session-scoped mocker fixture for patching during the test session.

tests.conftest.single_atom_molecule()[source]

Single argon atom – edge case for bond detection.

tests.conftest.single_model_pdb_file(tmpdir)[source]

PDB file with one implicit model (no MODEL/ENDMDL records).

tests.conftest.single_molecule_cdx_file_imidazole(chemdraw_directory)[source]
tests.conftest.single_molecule_cdxml_file_benzene(chemdraw_directory)[source]
tests.conftest.single_molecule_cdxml_file_methane(chemdraw_directory)[source]
tests.conftest.single_molecule_xyz_file(xyz_directory)[source]
tests.conftest.smd_TBME_solvent_parameters_text_file(txt_path)[source]
tests.conftest.smd_TBME_solvent_parameters_txt_file(txt_path)[source]
tests.conftest.spin_cube_file(cube_test_directory)[source]
tests.conftest.structure_test_directory(test_data_directory)[source]
tests.conftest.td_outputfile(tddft_test_directory)[source]
tests.conftest.tddft_test_directory(gaussian_test_directory)[source]
tests.conftest.temp_folder_with_files()[source]
tests.conftest.temp_text_file()[source]
tests.conftest.test_data_directory()[source]
tests.conftest.tests_logger()[source]

Fixture to configure the root logger for tests.

tests.conftest.tetrahydrofuran_molecule()[source]
tests.conftest.text_directory(gaussian_test_directory)[source]
tests.conftest.ts_conformers_log_directory(structure_test_directory)[source]

Directory containing TS conformer log files (ch_1c_para_c1.log to c5.log).

tests.conftest.two_rotated_molecules_xyz_file(xyz_directory)[source]
tests.conftest.txt_path(gaussian_test_directory)[source]
tests.conftest.utils_test_directory(test_data_directory)[source]
tests.conftest.water_engrad_path(orca_outputs_directory)[source]
tests.conftest.water_molecule()[source]

H₂O with realistic geometry.

tests.conftest.water_opt_input_path(inpfile_path)[source]
tests.conftest.water_output_gas_path(orca_outputs_directory)[source]
tests.conftest.water_sp_gas_input_path(orca_inputs_directory)[source]
tests.conftest.water_sp_gas_path(orca_outputs_directory)[source]
tests.conftest.water_sp_input_path(inpfile_path)[source]
tests.conftest.water_sp_solv_input_path(orca_inputs_directory)[source]
tests.conftest.water_sp_solv_path(orca_outputs_directory)[source]
tests.conftest.water_with_metadata_molecule()[source]

Water molecule with PDB residue metadata.

tests.conftest.wbi_outputfile(outputs_test_directory)[source]
tests.conftest.xtb_optimized_xyz_file(xyz_directory)[source]
tests.conftest.xyz_directory(structure_test_directory)[source]

tests.test_GaussianGenECP module

class tests.test_GaussianGenECP.TestGaussianGenGenECP[source]

Bases: object

test_gen_fallback_when_heavy_element_does_not_require_ecp(caplog)[source]
test_genecp_fallback_when_basis_missing_from_bse(caplog)[source]
test_genecp_from_base_api(tmpdir, reference_genecp_txt_file_from_api)[source]
test_genecp_from_base_api_accepts_hyphenless_def2_heavy_basis()[source]
test_genecp_from_comfile(tmpdir, gaussian_opt_genecp_inputfile, genecp_txt_file_from_web)[source]
test_genecp_from_modred_gen_comfile(tmpdir, modred_gen_inputfile, gen_txt_file_from_web)[source]
test_genecp_from_modred_genecp_comfile(modred_genecp_inputfile)[source]
test_genecp_from_modred_genecp_solvent_comfile(modred_genecp_custom_solvent_inputfile)[source]
class tests.test_GaussianGenECP.TestGenECPReplacementInRoute[source]

Bases: object

Test that gen/genecp replacement in route strings doesn’t affect other keywords.

test_gen_replacement_does_not_affect_noeigentest()[source]

Test that ‘gen’ in ‘noeigentest’ is not replaced, and case mode behaves correctly.

test_gen_to_genecp_replacement()[source]

Test replacing ‘gen’ with ‘genecp’ in route strings for both case modes.

test_genecp_replacement_does_not_affect_other_keywords()[source]

Test that ‘genecp’ replacement works correctly in both case modes.

test_replacement_with_various_delimiters()[source]

Test that replacement works correctly with various delimiters, in both case modes.

class tests.test_GaussianGenECP.TestGenGenECPBasisDetermination[source]

Bases: object

Test automatic determination of gen vs genecp basis keywords based on elements present.

test_determine_basis_keyword_mixed_elements()[source]

Test molecule with both gen and genecp elements uses genecp.

test_determine_basis_keyword_no_heavy_elements()[source]

Test that molecules with no heavy elements use light elements basis.

test_determine_basis_keyword_non_gen_basis()[source]

Test that non-gen/genecp basis keywords are returned unchanged.

test_determine_basis_keyword_with_br()[source]

Test that molecules with only Br use ‘gen’ instead of ‘genecp’.

test_determine_basis_keyword_with_i()[source]

Test that molecules with I use ‘genecp’.

test_determine_basis_keyword_with_pd()[source]

Test that molecules with Pd use ‘genecp’.

test_periodic_table_requires_ecp()[source]

Test that requires_ecp correctly identifies elements needing ECPs.

tests.test_GaussianIO module

class tests.test_GaussianIO.TestGaussian16Input[source]

Bases: object

test_oniom_charge_multiplicity(gaussian_qmmm_inputfile_3layer)[source]
test_partition(gaussian_qmmm_inputfile_2layer)[source]
test_pbc_1d_input(gaussian_pbc_1d_inputfile)[source]
test_read_frozen_coords(gaussian_frozen_opt_inputfile)[source]
test_read_gaussian_input(gaussian_opt_inputfile)[source]
test_read_genecp_inputfile(gaussian_opt_genecp_inputfile)[source]
test_read_modred_inputfile(gaussian_modred_inputfile)[source]
test_read_scan_inputfile(gaussian_scan_inputfile)[source]
class tests.test_GaussianIO.TestGaussian16Output[source]

Bases: object

test_contribution_percentage_spin_scaling()[source]
test_energy_extraction_from_gaussian_output_file(gaussian_quintet_opt_outfile)[source]
test_normal_termination_semiempirical_pm6_output_file(gaussian_semiempirical_pm6_output_file)[source]
test_normal_termination_with_forces_and_frequencies(td_outputfile)[source]
test_normal_termination_with_trailing_blank_lines(gaussian_ts_genecp_outfile, tmp_path)[source]
test_oldform_redundant_coordinates_atomic_numbers(tmp_path)[source]
test_pd_insertion_ts_r_logfile(gaussian_pd_insertion_ts_r_outfile)[source]
test_quintet_opt_output(gaussian_quintet_opt_outfile)[source]
test_read_frozen_opt_outputfile(gaussian_frozen_opt_outfile)[source]
test_read_genecp_outputfile(gaussian_ts_genecp_outfile)[source]
test_read_hirshfeld_charges_outputfile(gaussian_hirshfeld_outfile)[source]
test_read_hirshfeld_rc_charges_outputfile(gaussian_rc_hirshfeld_outfile)[source]
test_read_modred_outputfile(gaussian_failed_modred_outfile)[source]
test_read_mp2_outputfile(gaussian_mp2_outputfile)[source]
test_read_oniom_outputfile(gaussian_oniom_outputfile)[source]
test_read_scan_outputfile(gaussian_failed_scan_outfile)[source]
test_singlet_opt_output(gaussian_singlet_opt_outfile)[source]
test_triplet_opt_output(gaussian_triplet_opt_outfile)[source]
class tests.test_GaussianIO.TestGaussianCubeFile[source]

Bases: object

test_read_file_content(spin_cube_file)[source]
class tests.test_GaussianIO.TestGaussianPBCOutputFile[source]

Bases: object

test_read_2d_pbc_output(gaussian_pbc_2d_outputfile)[source]
class tests.test_GaussianIO.TestGaussianWBIOutput[source]

Bases: object

test_molecules(gaussian_benzene_opt_outfile)[source]
test_normal_termination_with_forces_and_frequencies(wbi_outputfile)[source]
class tests.test_GaussianIO.TestRouteString[source]

Bases: object

test_read_additional_route_parameters()[source]
test_read_route_semiempirical()[source]
test_read_route_string_nonstandard()[source]
test_read_route_string_opt_options()[source]
test_read_route_string_standard()[source]
test_read_route_string_standard2()[source]
test_read_route_string_standard3a()[source]
test_read_route_string_standard3b()[source]
test_read_route_string_standard4()[source]
test_read_route_string_standard5()[source]
test_read_route_string_standard6()[source]
test_read_route_string_standard7()[source]
test_solvent_in_route()[source]

tests.test_GaussianSettings module

class tests.test_GaussianSettings.TestGaussianJobFromComFile[source]

Bases: object

test_cli_group_remove_solvent_overrides_project_settings(gaussian_yaml_settings_gas_solv_project_name)[source]

--remove-solvent at the gaussian group level clears project solvent.

This simulates: gaussian --remove-solvent sp when the project’s solvent-phase sp settings carry a solvent model.

test_cli_group_solvent_options_propagate_to_opt(gaussian_yaml_settings_gas_solv_project_name)[source]

Solvent options given at the gaussian group level propagate to opt settings.

This simulates: gaussian -sm smd -si water -so iterative opt where the solvent options live on the group command and are merged into the subcommand settings via GaussianJobSettings.merge().

test_cli_group_solvent_options_propagate_to_td()[source]

Solvent options given at the gaussian group level propagate to td settings.

This simulates: gaussian -sm smd -si water -so iterative td

test_include_solvent(gaussian_opt_inputfile, tmpdir)[source]
test_reads_com_file(gaussian_opt_inputfile)[source]
test_update_solvent(gaussian_opt_inputfile, tmpdir)[source]
class tests.test_GaussianSettings.TestGaussianJobFromLogFile[source]

Bases: object

test_accumulates_settings(tmpdir, gaussian_ts_genecp_outfile)[source]
test_reads_gaussian_pm6_outfile(tmpdir, gaussian_semiempirical_pm6_output_file)[source]
test_reads_gaussian_ts_genecp_outfile(tmpdir, gaussian_ts_genecp_outfile)[source]
test_reads_oldform_redundant_coordinates_with_atomic_numbers(tmp_path)[source]
test_reads_pd_insertion_ts_r_logfile(gaussian_pd_insertion_ts_r_outfile)[source]
class tests.test_GaussianSettings.TestGaussianJobSettings[source]

Bases: object

test_get_settings_from_yaml_gas_solv(gaussian_yaml_settings_gas_solv)[source]
test_get_settings_from_yaml_solv(gaussian_yaml_settings_solv)[source]
test_merge_dict()[source]
test_merge_other_settings()[source]
test_read_gaussian_hf_comfile(hf_com_filepath)[source]
test_read_gaussian_settings_from_orca_inp(water_sp_input_path)[source]
class tests.test_GaussianSettings.TestGaussianLinkJobSettingsGuess[source]

Bases: object

Tests for guess= formatting in GaussianLinkJobSettings route strings.

test_multiple_guess_options_with_parentheses()[source]

Multiple comma-separated options must be wrapped: guess=(mix,always)

test_pre_parenthesized_input_no_double_wrapping()[source]

Already-parenthesized input must not produce double parentheses.

test_pre_parenthesized_input_with_whitespace()[source]

Whitespace around parenthesized input must be handled.

test_single_guess_option_no_parentheses()[source]

Single option must appear without parentheses: guess=mix

class tests.test_GaussianSettings.TestGaussianPBCJob[source]

Bases: object

test_writes_gaussian_input_from_pbc_comfile(tmpdir, gaussian_pbc_3d_outputfile)[source]
class tests.test_GaussianSettings.TestGaussianQMMMJobSettings[source]

Bases: object

test_qmmm_additional_opt_options_in_route()[source]

Regression test: -o/additional_opt_options_in_route must be merged into the opt/ts/modred keyword in the QMMM route string. Previously this field was silently ignored.

test_qmmm_additional_route_parameters()[source]

Regression test: -r/additional_route_parameters must appear in the QMMM route string. Previously _get_route_string_from_jobtype() in GaussianQMMMJobSettings never appended this field, so keywords like ‘scf=xqc’ were silently dropped.

test_qmmm_settings()[source]
test_qmmm_settings_for_atoms(gaussian_inputs_test_directory, gaussian_semiempirical_pm6_output_file)[source]
test_qmmm_settings_for_charge_and_multiplicity()[source]
class tests.test_GaussianSettings.TestGaussianRoute[source]

Bases: object

gas_route = 'opt=(ts,calcfc,noeigentest) freq m062x def2svp'
gas_route2 = 'opt b3lyp 6-31G(d) empiricaldispersion=gd3bj'
solv_route = 'mn15 def2svp scrf=(smd,solvent=DiChloroMethane)'
solv_route2 = '# opt=(calcfc,ts,noeigentest,maxstep=5) freq\nscrf=(smd,solvent=chlorobenzene) nosymm scf=qc def2svp m06'
test_settings_from_route()[source]
test_settings_from_route2()[source]
test_settings_from_route3()[source]
test_settings_from_route4()[source]

tests.test_GaussianWriter module

class tests.test_GaussianWriter.TestGaussianInputWriter[source]

Bases: object

test_write_gaussian_input_from_pbc_logfile(tmpdir, gaussian_yaml_settings_gas_solv_project_name, gaussian_pbc_2d_outputfile, gaussian_jobrunner_no_scratch, gaussian_written_opt_from_graphite_2d_pbc_log)[source]
test_write_modred_job(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_modred_file)[source]
test_write_modred_with_custom_basis_for_all_elements_in_structure_using_api(tmpdir, gaussian_yaml_settings_gas_solv_project_name, modred_genecp_inputfile, gaussian_jobrunner_no_scratch, gaussian_modred_with_custom_basis_for_all_atoms_from_api)[source]
test_write_opt_input_from_logfile(tmpdir, gaussian_yaml_settings_gas_solv_project_name, gaussian_singlet_opt_outfile, gaussian_jobrunner_no_scratch, gaussian_written_ts_from_nhc_singlet_log_file)[source]

Taking the Gaussian nhc_neutral_singlet.log output and write aldehyde_opt.com using the settings from the .log file.

test_write_opt_job(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_opt_file)[source]
test_write_opt_job_with_route(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_opt_file_with_route)[source]
test_write_qmmm_input_from_logfile(tmpdir, gaussian_yaml_settings_qmmm_project_name, gaussian_singlet_opt_outfile, gaussian_jobrunner_no_scratch, gaussian_written_qmmm_log_file)[source]

Taking the Gaussian nhc_neutral_singlet.log output and write qmmm .com

test_write_qmmm_job(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_qmmm_project_name, gaussian_written_qmmm_file, gaussian_jobrunner_no_scratch)[source]
test_write_scan_job_multiple_degrees_of_freedom(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_scan_multiple_degrees_of_freedom_file)[source]
test_write_scan_job_multiple_degrees_of_freedom_with_constraints(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_scan_multiple_degrees_of_freedom_with_constraints_file)[source]
test_write_scan_job_single_degree_of_freedom(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_scan_single_degree_of_freedom_file)[source]
test_write_semiempirical_opt_job(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_pm6_opt_file)[source]
test_write_sp_input_with_solvation_from_logfile(tmpdir, gaussian_yaml_settings_gas_solv_project_name, gaussian_singlet_opt_outfile, gaussian_jobrunner_no_scratch, gaussian_written_sp_from_nhc_singlet_log_with_solvent_file)[source]

Test writing simple .com input file using settings from .log file, including solvation.

test_write_sp_with_custom_solvation_from_logfile(tmpdir, gaussian_yaml_settings_gas_solv_project_name, gaussian_singlet_opt_outfile, gaussian_jobrunner_no_scratch, smd_TBME_solvent_parameters_text_file, gaussian_written_sp_from_nhc_singlet_log_with_custom_solvent_file)[source]

Test writing input file from log file. Simply taking the Gaussian nhc_neutral_singlet.log output and write gaussian_sp_custom_solv.com using the settings from the .log file and including custom solvation parameters from file smd_TBME.

test_write_ts_job(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_ts_file)[source]
test_write_ts_with_custom_basis_from_logfile(tmpdir, gaussian_yaml_settings_gas_solv_project_name, gaussian_singlet_opt_outfile, gaussian_jobrunner_no_scratch, Ni_def2tzvp_PCHOSi_svp_text_file, gaussian_written_sp_from_nhc_singlet_log_with_custom_basis_file)[source]
test_write_ts_with_custom_basis_using_api(tmpdir, gaussian_yaml_settings_gas_solv_project_name, gaussian_ts_genecp_outfile, gaussian_jobrunner_no_scratch, gaussian_written_sp_from_nhc_singlet_log_with_custom_basis_from_api_file)[source]

tests.test_ORCAIO module

class tests.test_ORCAIO.TestORCABasis[source]

Bases: object

test_orca_all_auxiliary_basis_sets()[source]
class tests.test_ORCAIO.TestORCAEngrad[source]

Bases: object

test_read_water_output(water_engrad_path)[source]
class tests.test_ORCAIO.TestORCAInput[source]

Bases: object

test_orca_faulty_solvent(orca_faulty_solv)[source]
test_orca_neb_input_with_xyz_files_specified(tmpdir, orca_input_nebts_file, orca_input_nebts_reactant_xyz_file, orca_input_nebts_product_xyz_file, orca_input_nebts_ts_xyz_file)[source]
test_orca_qmmm_input(orca_inputs_directory)[source]
test_read_solvent(orca_epr_solv)[source]
test_read_water_opt_input(water_opt_input_path)[source]
test_read_water_sp_input(water_sp_input_path)[source]
class tests.test_ORCAIO.TestORCANEB[source]

Bases: object

test_read_neb_output(orca_neb_output_file)[source]
class tests.test_ORCAIO.TestORCANEBInput[source]

Bases: object

Test suite for ORCANEBInput class.

test_neb_input_all_properties(tmpdir)[source]

Test reading all NEB input properties at once.

test_neb_input_case_insensitive(tmpdir)[source]

Test that NEB input parsing is case-insensitive.

test_neb_input_charge_and_multiplicity(orca_input_nebts_file)[source]

Test reading charge and multiplicity from NEB input.

test_neb_input_ending_xyzfile(orca_input_nebts_file)[source]

Test reading ending XYZ file from NEB input.

test_neb_input_inherits_from_orca_input(orca_input_nebts_file)[source]

Test that ORCANEBInput inherits from ORCAInput.

test_neb_input_nimages(orca_input_nebts_file)[source]

Test reading number of images from NEB input.

test_neb_input_pre_optimization_false(orca_input_nebts_file)[source]

Test reading pre-optimization flag (False) from NEB input.

test_neb_input_restarting_allxyzfile_none(orca_input_nebts_file)[source]

Test that restarting_allxyzfile is None when not specified.

test_neb_input_starting_xyzfile(orca_input_nebts_file)[source]

Test reading starting XYZ file from NEB input.

test_neb_input_ts_xyzfile(orca_input_nebts_file)[source]

Test reading TS XYZ file from NEB input.

test_neb_input_with_preopt_true(tmpdir)[source]

Test reading NEB input with pre-optimization enabled.

test_neb_input_with_restart_file(tmpdir)[source]

Test reading NEB input with restart file.

test_neb_input_without_ts_file(tmpdir)[source]

Test reading NEB input without TS guess file.

test_read_neb_input_basic(orca_input_nebts_file)[source]

Test basic reading of NEB input file.

class tests.test_ORCAIO.TestORCANEBJobSettings[source]

Bases: object

Test suite for ORCANEBJobSettings class.

test_equality_different_intermediate_xyzfile()[source]

Test that settings with different intermediate file are not equal.

test_equality_different_joboption()[source]

Test that settings with different joboption are not equal.

test_equality_different_nimages()[source]

Test that settings with different nimages are not equal.

test_equality_different_parent_attributes()[source]

Test that settings with different parent class attributes are not equal.

test_equality_different_preopt_ends()[source]

Test that settings with different preopt_ends are not equal.

test_equality_different_restarting_xyzfile()[source]

Test that settings with different restart file are not equal.

test_equality_different_semiempirical()[source]

Test that settings with different semiempirical method are not equal.

test_equality_identical_settings()[source]

Test that identical NEB settings are equal.

test_equality_includes_all_neb_attributes()[source]

Test that all 7 NEB-specific attributes are included in equality check.

test_inheritance()[source]

Test inheritance from ORCAJobSettings.

test_init_default()[source]

Test default initialization.

test_init_with_parameters()[source]

Test initialization with parameters.

test_neb_block_basic(tmpdir)[source]

Test basic NEB block generation via ORCAInputWriter.

test_route_string_generation()[source]

Test route string generation.

test_validation_errors()[source]

Test validation raises appropriate errors.

class tests.test_ORCAIO.TestORCAOutput[source]

Bases: object

test_fe2_quintet_orbital_properties(fe2_quintet_output)[source]

Test HOMO/LUMO/SOMO properties for Fe2 quintet state.

test_fe2_singlet_orbital_properties(fe2_singlet_output)[source]

Test HOMO/LUMO properties for Fe2 singlet state.

test_fe2_triplet_orbital_properties(fe2_triplet_output)[source]

Test HOMO/LUMO/SOMO properties for Fe2 triplet state.

test_fe3_doublet_orbital_properties(fe3_doublet_output)[source]

Test HOMO/LUMO/SOMO properties for Fe3 doublet state.

test_fe3_quartet_orbital_properties(fe3_quartet_output)[source]

Test HOMO/LUMO/SOMO properties for Fe3 quartet state.

test_fe3_sextet_orbital_properties(fe3_sextet_output)[source]

Test HOMO/LUMO/SOMO properties for Fe3 sextet state.

test_get_constrained_atoms(orca_fixed_atoms, orca_fixed_bonds_and_angles, orca_fixed_dihedral)[source]
test_get_constrained_bond_lengths_and_angles(orca_fixed_bonds_and_angles)[source]
test_get_constrained_dihedral_angles(orca_fixed_dihedral)[source]
test_gtoint_errfile(gtoint_errfile)[source]
test_he_freq_output(orca_he_output_freq)[source]
test_read_hirshfeld_full_print_output(hirshfeld_full_print)[source]
test_read_sp_full_print_output(dlpno_ccsdt_sp_full_print)[source]
test_read_sp_output(water_sp_gas_path)[source]
test_read_water_output(water_output_gas_path)[source]
test_sn2_ts_orca_output(orca_sn2_ts_output)[source]
test_water_optimized_output(water_output_gas_path)[source]
class tests.test_ORCAIO.TestORCAQMMM[source]

Bases: object

test_read_qmmm_output(orca_two_layer_qmmmm_output_file)[source]
class tests.test_ORCAIO.TestORCAQMMMJobSettings[source]

Bases: object

test_charge_and_multiplicity_population()[source]

ORCAQMMMJobSettings should populate .charge and .multiplicity from intermediate or high fields.

test_partition_string_empty_and_none()[source]

Empty string or None should return empty partition block.

test_partition_string_qm_and_qm2()[source]

When both high_level_atoms and medium_level_atoms provided, both lines should be returned.

test_partition_string_single_and_list_input()[source]

Partition string should accept ‘1-15,37,39’ or list and compress ranges.

class tests.test_ORCAIO.TestORCARoute[source]

Bases: object

test_read_route()[source]

tests.test_PyMOLJobs module

class tests.test_PyMOLJobs.TestPyMOLCLIFolderOptions[source]

Bases: object

Folder options (-d/-t and -d/-p) in the mol CLI.

test_directory_filetype_label_auto_generated(tmp_path, invoke_mol_with_visualize)[source]

When -d/-t used, auto-generated label includes dir name.

test_directory_filetype_options_accepted(tmp_path, invoke_mol_with_visualize)[source]

mol -d dir -t log visualize is accepted and populates ctx.obj.

test_directory_program_label_auto_generated(tmp_path, invoke_mol_with_visualize)[source]

When -d/-p used, auto-generated label includes program name.

test_directory_program_options_accepted(tmp_path, invoke_mol_with_visualize)[source]

mol -d dir -p gaussian visualize is accepted and populates ctx.obj.

class tests.test_PyMOLJobs.TestPyMOLFileProcessingUsesSourceFilename[source]

Bases: object

test_generate_fchk_uses_source_basename_not_label(tmpdir, gaussian_benzene_opt_outfile, pymol_mo_jobrunner, monkeypatch)[source]
test_nci_uses_source_basename_for_cube_loading_and_command(tmpdir, gaussian_benzene_opt_outfile, pbs_server)[source]
test_spin_cli_custom_label_uses_source_basename_and_exact_output_name(gaussian_benzene_opt_outfile, invoke_mol_cli)[source]
test_spin_cubegen_uses_source_basename_fchk(tmpdir, gaussian_benzene_opt_outfile, pbs_server, monkeypatch)[source]
class tests.test_PyMOLJobs.TestPyMOLJobs[source]

Bases: object

pytestmark = [Mark(name='usefixtures', args=('skip_if_no_pymol',), kwargs={})]
test_pymol_MO_job_parameters(tmpdir, gaussian_benzene_opt_outfile)[source]
test_pymol_align_job_on_three_files(tmpdir, orca_input_nebts_reactant_xyz_file, gaussian_frozen_opt_inputfile, gaussian_singlet_opt_outfile, pymol_align_jobrunner)[source]
test_pymol_hybrid_visualization_job_custom_light_colors_on_xyz_file(tmpdir, dna_hybrid_visualized_xyz_file, pymol_hybrid_visualization_jobrunner)[source]
test_pymol_hybrid_visualization_job_on_xyz_file(tmpdir, dna_hybrid_visualized_xyz_file, pymol_hybrid_visualization_jobrunner)[source]
test_pymol_hybrid_visualization_job_with_redundant_colors_on_xyz_file(tmpdir, dna_hybrid_visualized_xyz_file, pymol_hybrid_visualization_jobrunner)[source]
test_pymol_irc_movie_job_on_gaussian_log_multiple_structures(tmpdir, gaussian_singlet_opt_outfile, pymol_ircmovie_jobrunner)[source]
test_pymol_movie_job_on_gaussian_com_file(tmpdir, gaussian_opt_inputfile, pymol_movie_jobrunner)[source]
test_pymol_nci_job_on_gaussian_com_file(tmpdir, gaussian_opt_inputfile, pymol_movie_jobrunner)[source]
test_pymol_nci_job_parameters(tmpdir, gaussian_benzene_opt_outfile)[source]
test_pymol_spin_job_on_gaussian_com_file(tmpdir, gaussian_opt_inputfile, pymol_movie_jobrunner)[source]
test_pymol_spin_job_parameters(tmpdir, gaussian_benzene_opt_outfile)[source]
test_pymol_visualization_job_on_gaussian_com_file(tmpdir, gaussian_opt_inputfile, pymol_visualization_jobrunner)[source]
test_pymol_visualization_job_on_gaussian_log_file(gaussian_singlet_opt_outfile, tmpdir, pymol_visualization_jobrunner)[source]
test_pymol_visualization_job_on_gaussian_log_multiple_structures(tmpdir, gaussian_singlet_opt_outfile, pymol_visualization_jobrunner)[source]
test_pymol_visualization_job_on_orca_inp_file(tmpdir, water_opt_input_path, pymol_visualization_jobrunner)[source]
test_pymol_visualization_job_on_orca_out_file(tmpdir, water_output_gas_path, pymol_visualization_jobrunner)[source]
test_pymol_visualization_job_on_pubchem_id(tmpdir, pymol_visualization_jobrunner)[source]
test_pymol_visualization_job_on_smiles(tmpdir, pymol_visualization_jobrunner)[source]
tests.test_PyMOLJobs.skip_if_no_pymol()[source]

tests.test_YAMLIO module

class tests.test_YAMLIO.TestYAMLFile[source]

Bases: object

test_server_yaml(server_yaml_file)[source]

tests.test_converter module

class tests.test_converter.TestConverter[source]

Bases: object

test_convert_com_folder_to_xyz(tmpdir, gaussian_inputs_test_directory)[source]
test_convert_log_folder_to_com(tmpdir, gaussian_outputs_test_directory)[source]
test_convert_log_folder_to_xyz(tmpdir, gaussian_outputs_test_directory)[source]
test_convert_single_comfile_to_xyz(tmpdir, gaussian_opt_inputfile)[source]
test_convert_single_failed_modred_log_file_to_xyz(gaussian_failed_modred_outfile, tmpdir)[source]
test_convert_single_failed_oniom_log_file_to_xyz(gaussian_oniom_outputfile, tmpdir)[source]
test_convert_single_logfile_to_com(tmpdir, gaussian_singlet_opt_outfile)[source]
test_convert_single_opt_log_file_to_xyz(gaussian_acetone_opt_outfile, tmpdir)[source]
test_convert_single_sp_log_file_to_xyz(gaussian_benzene_opt_outfile, tmpdir)[source]
test_convert_single_wbi_log_file_to_xyz(wbi_outputfile, tmpdir)[source]
test_convert_xyz_folder_to_com(tmpdir, xyz_directory)[source]
class tests.test_converter.TestPDBFile[source]

Bases: object

test_atom_names(single_model_pdb_file)[source]
test_blank_element_columns_infer_two_letter_elements(blank_element_pdb_file)[source]
test_chain_ids(single_model_pdb_file)[source]
test_convert_cdxml_folder_to_com(tmpdir, chemdraw_directory)[source]
test_convert_cdxml_folder_to_xyz(tmpdir, chemdraw_directory)[source]
test_convert_multi_molecule_cdxml_to_xyz_splits_files(tmpdir, multi_molecule_cdxml_file)[source]
test_convert_single_cdx_to_xyz(tmpdir, single_molecule_cdx_file_imidazole)[source]
test_convert_single_cdxml_to_com(tmpdir, single_molecule_cdxml_file_benzene)[source]
test_convert_single_cdxml_to_xyz(tmpdir, single_molecule_cdxml_file_methane)[source]
test_empty_file_raises_value_error(empty_pdb_file)[source]
test_filepath_resolves_absolute(single_model_pdb_file)[source]
test_get_molecules_all(multi_model_pdb_file)[source]
test_get_molecules_first(multi_model_pdb_file)[source]
test_get_molecules_last(multi_model_pdb_file)[source]
test_infer_element_ca_is_carbon()[source]

CA is a biomolecular atom label (C-alpha), should resolve to C.

test_infer_element_cl()[source]
test_infer_element_digits_only_raises()[source]
test_infer_element_empty_raises()[source]
test_infer_element_fe()[source]
test_infer_element_leading_digit()[source]

Leading digits should be stripped: 1H -> H.

test_infer_element_zn()[source]
test_info_dict_populated(single_model_pdb_file)[source]
test_init_stores_filename(single_model_pdb_file)[source]
test_molecule_from_filepath_uses_pdbfile(single_model_pdb_file)[source]

Molecule.from_filepath for .pdb should produce identical results.

test_molecule_property_raises_on_empty(empty_pdb_file)[source]
test_molecule_property_returns_last_model(multi_model_pdb_file)[source]
test_molecule_returns_molecule_object(single_model_pdb_file)[source]
test_num_atoms(single_model_pdb_file)[source]
test_pdb_infer_pdb_element()[source]
test_pdb_molecule_from_pdb_atom_lines()[source]
test_pdb_parse_pdb_models(multi_model_pdb_file)[source]
test_positions(single_model_pdb_file)[source]
test_raw_lines_preserves_column_whitespace(single_model_pdb_file)[source]

raw_lines must not strip leading spaces (fixed-width PDB format).

test_raw_lines_strips_trailing_newlines(single_model_pdb_file)[source]
test_record_types(single_model_pdb_file)[source]
test_repr(single_model_pdb_file)[source]
test_residue_names(single_model_pdb_file)[source]
test_residue_numbers(single_model_pdb_file)[source]
test_return_list_wraps_single(multi_model_pdb_file)[source]
test_str(single_model_pdb_file)[source]
test_symbols(single_model_pdb_file)[source]
test_write_creates_file(single_model_pdb_file, tmpdir)[source]
test_write_output_contains_atom_records(single_model_pdb_file, tmpdir)[source]
test_write_round_trip_preserves_atom_count(single_model_pdb_file, tmpdir)[source]

Write then re-read should give the same number of atoms.

test_write_round_trip_preserves_positions(single_model_pdb_file, tmpdir)[source]
test_write_round_trip_preserves_symbols(single_model_pdb_file, tmpdir)[source]

tests.test_groupers module

class tests.test_groupers.TestConformerIdExtraction[source]

Bases: object

Test conformer ID extraction from filenames.

test_all_files_without_cxx_pattern()[source]

Test that a folder with no _cXX_ pattern files works correctly.

test_conformer_id_fallback_to_filename()[source]

Test that filename is used as conformer ID when no _cXX_ pattern.

test_conformer_ids_molecules_correspondence(ts_conformers_log_directory, temp_working_dir)[source]

Test that conformer_ids and molecules are strictly one-to-one corresponding.

This verifies that after sorting, each molecule’s energy matches the energy from its corresponding file (identified by conf_id).

test_extract_conformer_id_with_pattern()[source]

Test extraction with _cXX_ pattern.

test_extract_conformer_id_without_pattern()[source]

Test extraction without _cXX_ pattern returns None.

test_mixed_pattern_files_correspondence()[source]

Test correspondence when mixing files with and without _cXX_ pattern.

class tests.test_groupers.Test_BasicRMSD_grouper_and_basic_functionality[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_num_groups_parameter(multiple_molecules_xyz_file, temp_working_dir)[source]
test_pick_the_lowestenergy_conformers(multiple_molecules_xyz_file, temp_working_dir)[source]
test_rmsd_grouper(methanol_molecules, methanol_and_ethanol, temp_working_dir)[source]
test_rmsd_grouper_for_crest_conformers(multiple_molecules_xyz_file, temp_working_dir)[source]
test_rmsd_grouper_for_crest_conformers_ignore_Hs(multiple_molecules_xyz_file, temp_working_dir)[source]
test_rmsd_grouper_for_rotated_molecules(two_rotated_molecules_xyz_file, temp_working_dir)[source]
class tests.test_groupers.Test_EnergyGrouper[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_energy_extraction_from_ts_log_files(ts_conformers_log_directory, temp_working_dir)[source]

Test that energy is correctly extracted from TS log files as SCF Done energy.

test_energy_extraction_from_xyz_file(multiple_molecules_xyz_file, temp_working_dir)[source]
test_energy_grouper_for_crest_conformers(multiple_molecules_xyz_file, temp_working_dir)[source]

Test EnergyGrouper with molecules that have energy information.

test_energy_grouper_for_log_conformers(ts_conformers_log_directory, temp_working_dir)[source]

Test EnergyGrouper with molecules loaded from log files using Gibbs energy.

test_energy_grouper_raises_error_for_missing_energy(methanol_molecules, temp_working_dir)[source]
test_gibbs_energy_extraction_function(ts_conformers_log_directory, temp_working_dir)[source]

Test that Gaussian16Output.gibbs_free_energy extracts correct value.

class tests.test_groupers.Test_HungarianRMSD_grouper[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_hrmsd_grouper_for_crest_molecules(multiple_molecules_xyz_file, temp_working_dir)[source]
test_hrmsd_grouper_for_rotated_molecules(two_rotated_molecules_xyz_file, temp_working_dir)[source]
test_ignore_hydrogen(multiple_molecules_xyz_file, temp_working_dir)[source]
class tests.test_groupers.Test_IRMSD_grouper[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={}), Mark(name='skipif', args=(True,), kwargs={'reason': 'irmsd command not available'})]
test_ignore_hydrogen(two_rotated_molecules_xyz_file, temp_working_dir)[source]
test_irmsd_grouper_for_crest_molecules(multiple_molecules_xyz_file, temp_working_dir)[source]
test_irmsd_grouper_for_rotated_molecules(two_rotated_molecules_xyz_file, temp_working_dir)[source]
class tests.test_groupers.Test_PymolRMSD_grouper[source]

Bases: object

NUM_PROCS = 1
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
classmethod setup_class()[source]

Initialize PyMOL once for all tests in this class.

classmethod teardown_class()[source]

Clean up PyMOL after all tests in this class are done.

teardown_method(method)[source]

Clean up PyMOL objects after each test method to prevent slowdown.

test_ignore_hydrogen(multiple_molecules_xyz_file, temp_working_dir)[source]
test_pymol_grouper_rejects_multiproc(methanol_molecules, temp_working_dir)[source]

Test that PyMOL grouper raises error when num_procs > 1.

test_pymolrmsd_grouper_for_crest_molecules(multiple_molecules_xyz_file, temp_working_dir)[source]
test_pymolrmsd_grouper_for_rotated_molecules(two_rotated_molecules_xyz_file, temp_working_dir)[source]
class tests.test_groupers.Test_SpyRMSD_grouper[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_ignore_hydrogen(multiple_molecules_xyz_file, temp_working_dir)[source]
test_spyrmsd_grouper_for_crest_molecules(multiple_molecules_xyz_file, temp_working_dir)[source]
test_spyrmsd_grouper_for_rotated_molecules(two_rotated_molecules_xyz_file, temp_working_dir)[source]
class tests.test_groupers.Test_Tanimoto_similarity_grouper[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_tanimoto_grouper_for_crest_conformers(multiple_molecules_xyz_file, temp_working_dir)[source]
test_tanimoto_similarity_grouper(methanol_molecules, methanol_and_ethanol, temp_working_dir)[source]
class tests.test_groupers.Test_TorsionFingerprint_grouper[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_count_groups_matches_complete_linkage_iteration_order(methanol_molecules)[source]
test_torsionfingerprint_grouper_for_crest_molecules(multiple_molecules_xyz_file, temp_working_dir)[source]
test_torsionfingerprint_grouper_for_rotated_molecules(two_rotated_molecules_xyz_file, temp_working_dir)[source]
test_use_maxdev_parameter(multiple_molecules_xyz_file, temp_working_dir)[source]
test_use_weights_parameter(multiple_molecules_xyz_file, temp_working_dir)[source]
class tests.test_groupers.Test_conformer_ids_functionality[source]

Bases: object

Test conformer_ids parameter functionality.

NUM_PROCS = 1
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_conformer_ids_from_log_directory(ts_conformers_log_directory, temp_working_dir)[source]

Test loading conformer IDs from a directory of log files.

test_traj_conformer_ids_original_indices(temp_working_dir)[source]

Test that traj job correctly sets original conformer indices.

class tests.test_groupers.Test_edge_cases[source]

Bases: object

Test edge cases and boundary conditions.

pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_different_formulas_always_separate(methanol_and_ethanol, temp_working_dir)[source]

Test that molecules with different formulas are always in separate groups.

test_num_groups_equals_num_molecules(methanol_molecules, temp_working_dir)[source]

Test requesting same number of groups as molecules.

test_num_groups_exceeds_num_molecules(methanol_molecules, temp_working_dir)[source]

Test requesting more groups than molecules.

test_rmsd_infinity_for_different_molecules(methanol_and_ethanol, temp_working_dir)[source]

Test that RMSD returns infinity for molecules with different atom counts.

test_two_molecules_grouping(temp_working_dir)[source]

Test grouping with minimum number of molecules (2).

test_very_high_threshold(multiple_molecules_xyz_file, temp_working_dir)[source]

Test with very high threshold (should create few groups).

test_very_low_threshold(multiple_molecules_xyz_file, temp_working_dir)[source]

Test with very low threshold (should create many groups).

class tests.test_groupers.Test_energy_extraction_function[source]

Bases: object

Framework tests for energy extraction by file type.

pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_energy_extraction_gaussian(gaussian_dppeFeCl2_link_opt_outputfile)[source]
test_energy_extraction_orca(fe2_singlet_output)[source]
class tests.test_groupers.Test_grouper_complete_linkage[source]

Bases: object

Test complete linkage clustering behavior.

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_complete_linkage_prevents_chaining(multiple_molecules_xyz_file, temp_working_dir)[source]

Test that complete linkage prevents chaining effect in grouping.

class tests.test_groupers.Test_grouper_utility_functions[source]

Bases: object

Test utility functions and helper methods in groupers.

NUM_PROCS = 1
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_grouping_result_caching(multiple_molecules_xyz_file, temp_working_dir)[source]

Test that grouping results are cached and reused.

test_rmsd_matrix_with_num_groups(multiple_molecules_xyz_file, temp_working_dir)[source]

Test that RMSD matrix filename reflects num_groups when used.

test_unique_returns_lowest_energy_representative(multiple_molecules_xyz_file, temp_working_dir)[source]

Test that unique() returns lowest energy molecule from each group.

class tests.test_groupers.Test_label_and_append_label[source]

Bases: object

Test -l (label) and -a (append_label) parameter functionality.

NUM_PROCS = 1
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_different_labels_create_different_outputs(multiple_molecules_xyz_file, temp_working_dir)[source]

Test that different labels create separate output directories.

test_get_label_function(temp_working_dir)[source]

Test _get_label function logic.

test_label_in_group_xyz_files(multiple_molecules_xyz_file, temp_working_dir)[source]

Test that label parameter affects group XYZ file names.

test_label_in_output_directory(multiple_molecules_xyz_file, temp_working_dir)[source]

Test that label parameter affects output directory name.

test_label_with_num_groups(multiple_molecules_xyz_file, temp_working_dir)[source]

Test that label works correctly with num_groups parameter.

class tests.test_groupers.Test_other_groupers[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_base_record_template_method(methanol_molecules)[source]
test_connectivity_grouper(methanol_molecules, methanol_and_ethanol, temp_working_dir)[source]
test_connectivity_grouper_for_crest_conformers(multiple_molecules_xyz_file, temp_working_dir)[source]
test_formula_grouper(methanol_molecules, methanol_and_ethanol, conformers_from_rdkit, temp_working_dir)[source]
test_rdkit_isomorphism_grouper(methanol_molecules, methanol_and_ethanol, temp_working_dir)[source]
test_record_writes_formula_outputs_with_headers(methanol_and_ethanol, temp_working_dir)[source]

Detailed record test: verify non-matrix output sheet and header lines.

test_record_writes_rmsd_matrix_with_headers(methanol_molecules, temp_working_dir)[source]

Detailed record test: verify matrix file and key header lines are written.

class tests.test_groupers.Test_output_file_generation[source]

Bases: object

Test that grouper generates correct output files.

NUM_PROCS = 1
pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
test_group_xyz_files_contain_energy_and_index_info(multiple_molecules_xyz_file, temp_working_dir)[source]

Test that group XYZ files contain energy and original index information.

test_group_xyz_files_energy_from_log_files(ts_conformers_log_directory, temp_working_dir)[source]

Test that energy is correctly extracted from log files and written to group XYZ files.

test_group_xyz_files_sorted_by_energy(multiple_molecules_xyz_file, temp_working_dir)[source]

Test that molecules in group XYZ files are sorted by energy (lowest first).

class tests.test_groupers.Testfactory[source]

Bases: object

pytestmark = [Mark(name='usefixtures', args=('temp_working_dir',), kwargs={})]
classmethod teardown_class()[source]

Clean up PyMOL after all tests in this class are done.

test_structure_grouper_factory(methanol_molecules, temp_working_dir)[source]
test_structure_grouper_factory_energy(multiple_molecules_xyz_file, temp_working_dir)[source]

Test factory creation of energy grouper (requires molecules with energy).

tests.test_groupers.temp_working_dir()[source]

Pytest fixture to create a temporary directory and change to it for testing. This prevents group_result folders from being created in the project directory.

tests.test_organizer module

class tests.test_organizer.TestOrganizer[source]

Bases: object

test_file_organizer(tmpdir, excel_file)[source]

tests.test_server module

class tests.test_server.TestServer[source]

Bases: object

test_gaussian_executable(server_yaml_file)[source]
test_orca_executable(server_yaml_file)[source]
test_server_yaml(server_yaml_file)[source]

tests.test_structures module

class tests.test_structures.TestCDXFile[source]

Bases: object

Tests for ChemDraw file reading functionality.

test_cdx_molecule_to_graph(single_molecule_cdxml_file_benzene)[source]

Test that molecules from CDXML can be converted to graph.

test_cdx_molecule_to_rdkit_conversion(single_molecule_cdxml_file_benzene)[source]

Test that molecules from CDXML can be converted to RDKit.

test_cdxfile_get_molecules_index(multi_molecule_cdxml_file)[source]

Test CDXFile.get_molecules with various index specifications.

test_molecule_from_filepath_cdxml(single_molecule_cdxml_file_benzene)[source]

Test Molecule.from_filepath with CDXML file.

test_molecule_from_filepath_cdxml_multi_molecules(multi_molecule_cdxml_file)[source]

Test reading multiple molecules from CDXML using from_filepath.

test_molecule_from_filepath_cdxml_pathlib(single_molecule_cdxml_file_benzene)[source]

Test Molecule.from_filepath with pathlib.Path.

test_molecule_from_filepath_cdxml_return_list(single_molecule_cdxml_file_benzene)[source]

Test return_list parameter with single molecule CDXML file.

test_read_complex_molecule_cdxml_file_(complex_molecule_cdxml_file)[source]

Test reading a single molecule from a CDXML file.

test_read_metal_ligand_molecules_cdxml_file_(metal_ligand_molecules_cdxml_file)[source]

Test reading multiple organometallic molecules from a CDXML file with Cp and aromatic ligands.

test_read_multi_molecule_cdxml_file(multi_molecule_cdxml_file)[source]

Test reading multiple molecules from a CDXML file.

test_read_single_molecule_cdx_file_imidazole(single_molecule_cdx_file_imidazole)[source]

Test reading a single molecule from a CDXML file.

test_read_single_molecule_cdxml_file_benzene(single_molecule_cdxml_file_benzene)[source]

Test reading a single molecule from a CDXML file.

test_read_single_molecule_cdxml_file_methane(single_molecule_cdxml_file_methane)[source]

Test reading a single molecule from a CDXML file.

class tests.test_structures.TestCXSMILES[source]

Bases: object

Tests for Molecule.cxsmiles property (RDKit backend).

EXPECTED_NORMAL = '[H]C([H])([H])C([H])([H])op(=O)oC([H])([H])C([H])([H])[H] |(3.6969,1.9448,0.2049;3.0842,1.2373,-0.3608;3.7313,0.4472,-0.7559;2.652,1.7556,-1.2232;1.9939,0.6488,0.5088;1.3583,1.4601,0.8855;2.4534,0.1313,1.3605;1.2255,-0.2622,-0.2653;0.0003,-0.9988,0.5013;0.0051,-2.2423,-0.2655;-1.2252,-0.2619,-0.2663;-1.9972,0.645,0.509;-2.4576,0.1238,1.3579;-1.364,1.4563,0.8899;-3.0867,1.2342,-0.3613;-3.702,1.9386,0.2054;-2.6535,1.756,-1.221;-3.7312,0.4439,-0.7604)|'
EXPECTED_R_ENANTIOMER = '[H]c1c([H])c([H])c(P(=O)(c2c([H])c([H])c([H])c([H])c2[H])C([H])([H])[C@@]2(C([H])([H])[H])c(=O)n(C([H])([H])[H])c3c([H])c([H])c([H])c([H])c32)c([H])c1[H] |(0.657587,4.92454,-1.29892;0.276843,3.96138,-0.951759;0.485742,2.81258,-1.71847;1.03401,2.87447,-2.66093;0.006912,1.57925,-1.27484;0.204594,0.685275,-1.87284;-0.6776,1.49046,-0.055628;-1.25801,-0.0518,0.702519;-1.3091,0.044461,2.20006;-2.88635,-0.380829,-0.012479;-3.12941,-0.354113,-1.39219;-2.32549,-0.092551,-2.08777;-4.40354,-0.645056,-1.87792;-4.59613,-0.624486,-2.95272;-5.43533,-0.955747,-0.986524;-6.43361,-1.18057,-1.36882;-5.19575,-0.974224,0.388852;-6.00568,-1.21169,1.08208;-3.92009,-0.687184,0.879324;-3.70148,-0.688059,1.9505;-0.227699,-1.40463,0.052757;-0.119079,-1.24802,-1.03485;-0.807656,-2.33494,0.17008;1.15351,-1.5942,0.72979;0.99867,-2.27426,2.08799;0.308383,-1.69441,2.71697;1.97119,-2.35931,2.59369;0.59233,-3.28598,1.93715;1.93427,-2.48285,-0.25179;1.70453,-3.64544,-0.504979;2.90906,-1.70492,-0.846562;3.81634,-2.19747,-1.84937;3.73917,-1.61247,-2.77951;3.54494,-3.24141,-2.05378;4.8593,-2.15693,-1.49649;2.95902,-0.433075,-0.262488;3.8266,0.615031,-0.550651;4.58376,0.527564,-1.3328;3.69973,1.78628,0.210751;4.36465,2.62845,0.005447;2.75405,1.88809,1.23239;2.68234,2.80776,1.81661;1.88531,0.820237,1.50649;1.12177,0.893949,2.28612;1.97673,-0.328846,0.734248;-0.882212,2.64496,0.711945;-1.38448,2.55034,1.67858;-0.411788,3.878,0.260678;-0.570718,4.77518,0.863087),wU:23.24|'
EXPECTED_R_ROTAMER = '[H]c1n=c(-c2c(-os(=O)(=O)C(F)(F)F)c([H])c([H])c3c([H])c([H])c([H])c([H])c23)c2c([H])c([H])c([H])c([H])c2c1[H] |(-0.329609,2.38122,-3.61273;-0.026158,2.27146,-2.56743;0.336125,1.02648,-2.1812;0.702396,0.825008,-0.934002;1.01703,-0.590455,-0.562362;-0.007714,-1.51067,-0.532668;-1.30548,-1.10616,-0.852577;-2.1204,-0.164611,0.168256;-2.55417,1.01923,-0.515766;-1.46291,-0.151398,1.44906;-3.57423,-1.28562,0.320271;-4.16542,-1.41565,-0.847695;-3.16121,-2.46571,0.747804;-4.41207,-0.76474,1.19438;0.181508,-2.86971,-0.206966;-0.687662,-3.52873,-0.187174;1.44931,-3.31282,0.079351;1.62504,-4.36094,0.333044;2.55451,-2.41778,0.057183;3.87361,-2.86277,0.348232;4.02499,-3.91674,0.595343;4.93563,-1.98941,0.318758;5.94394,-2.3428,0.544269;4.72459,-0.626471,-0.008915;5.57315,0.060292,-0.037079;3.46034,-0.164367,-0.295324;3.30174,0.885311,-0.552026;2.34077,-1.04278,-0.266984;0.743402,1.86566,0.050067;1.11738,1.6475,1.4052;1.36594,0.635744,1.73181;1.14034,2.69619,2.29419;1.42424,2.52279,3.3341;0.783222,4.00428,1.87401;0.805052,4.82508,2.59435;0.401105,4.23926,0.574492;0.114218,5.24117,0.245832;0.370036,3.17459,-0.368519;-0.025328,3.3532,-1.71845;-0.329238,4.34162,-2.07033)|'
EXPECTED_S_ENANTIOMER = '[H]c1c([H])c([H])c(P(=O)(c2c([H])c([H])c([H])c([H])c2[H])C([H])([H])[C@]2(C([H])([H])[H])c(=O)n(C([H])([H])[H])c3c([H])c([H])c([H])c([H])c32)c([H])c1[H] |(-4.10545,4.56874,0.709448;-3.52977,3.64265,0.645345;-3.31587,2.87242,1.79018;-3.72201,3.19528,2.7513;-2.57592,1.69184,1.70894;-2.37818,1.07929,2.59263;-2.05266,1.27517,0.478011;-1.13514,-0.28848,0.507738;-0.75977,-0.677078,1.90906;-2.21055,-1.523,-0.263839;-2.718,-1.39784,-1.56435;-2.48778,-0.513904,-2.16641;-3.52676,-2.40254,-2.09389;-3.92258,-2.30619,-3.10717;-3.83217,-3.53062,-1.32596;-4.46746,-4.31554,-1.7426;-3.3289,-3.6555,-0.02996;-3.56957,-4.53716,0.56812;-2.51594,-2.65283,0.503124;-2.10519,-2.72167,1.51378;0.246332,-0.126442,-0.664672;0.507903,-1.14931,-0.980531;-0.124177,0.404384,-1.55997;1.49769,0.604701,-0.148795;1.1654,1.86783,0.660908;0.549974,2.55301,0.05834;2.09382,2.38433,0.946933;0.621442,1.59517,1.57793;2.29809,1.06731,-1.37867;1.86402,1.731,-2.29803;3.58921,0.612819,-1.24748;4.63005,0.881221,-2.20479;5.4733,1.41251,-1.73622;4.19794,1.50997,-2.994;5.00869,-0.052287,-2.65075;3.72297,-0.193357,-0.108558;4.85777,-0.860668,0.337892;5.8052,-0.793848,-0.201106;4.73765,-1.62678,1.50603;5.61099,-2.16479,1.88194;3.52468,-1.71469,2.1904;3.45722,-2.32196,3.09528;2.38859,-1.03029,1.72864;1.4267,-1.09209,2.24455;2.49776,-0.268364,0.573364;-2.26183,2.05492,-0.668208;-1.83522,1.76286,-1.63193;-3.00036,3.23568,-0.582173;-3.1564,3.84433,-1.47533),wU:23.24|'
EXPECTED_S_ROTAMER = '[H]c1n=c(-c2c(-os(=O)(=O)C(F)(F)F)c([H])c([H])c3c([H])c([H])c([H])c([H])c23)c2c([H])c([H])c([H])c([H])c2c1[H] |(-0.329441,-2.38184,-3.61277;-0.026136,-2.27183,-2.56745;0.33626,-1.0268,-2.18149;0.702361,-0.825125,-0.934248;1.01698,0.590384,-0.562766;-0.007759,1.51064,-0.533148;-1.3055,1.10597,-0.853096;-2.12019,0.16467,0.168019;-1.46257,0.151709,1.44877;-2.55422,-1.01919,-0.515773;-3.57381,1.28579,0.320452;-3.16032,2.46582,0.747959;-4.16523,1.41612,-0.847356;-4.41149,0.765061,1.19469;0.181532,2.86961,-0.207313;-0.687458,3.52887,-0.187547;1.44935,3.31259,0.07922;1.62509,4.36068,0.33303;2.55452,2.41752,0.057133;3.87361,2.86235,0.348425;4.02509,3.91629,0.595642;4.93552,1.98887,0.319058;5.94384,2.34212,0.544769;4.7244,0.625956,-0.008734;5.5729,-0.060885,-0.036781;3.46015,0.164008,-0.295385;3.30143,-0.885637,-0.552158;2.3407,1.04257,-0.26718;0.743183,-1.86557,0.050012;1.11714,-1.64713,1.40512;1.36576,-0.635314,1.7315;1.1399,-2.69559,2.29437;1.42376,-2.522,3.33425;0.782587,-4.00373,1.87448;0.804249,-4.82437,2.595;0.400478,-4.23897,0.575013;0.11344,-5.24092,0.246622;0.369622,-3.17453,-0.368276;-0.025656,-3.35336,-1.71819;-0.329772,-4.34179,-2.06987)|'
test_enantiomers_differ(cxsmiles_r_enantiomer_file, cxsmiles_s_enantiomer_file)[source]

R and S enantiomers must produce different CXSMILES. The SMILES core itself differs (@@/@ chirality annotation).

test_large_molecule_c2_cxsmiles(cxsmiles_large_molecule_c2_file, cxsmiles_expected_large_c2_file)[source]

CXSMILES for a large molecule (c2) should match the expected value.

test_large_molecule_c3_cxsmiles(cxsmiles_large_molecule_c3_file, cxsmiles_expected_large_c3_file)[source]

CXSMILES for a large molecule (c3) should match the expected value.

test_large_molecules_differ(cxsmiles_large_molecule_c2_file, cxsmiles_large_molecule_c3_file)[source]

Two different large molecules should produce different CXSMILES.

test_r_enantiomer_cxsmiles(cxsmiles_r_enantiomer_file)[source]

CXSMILES for the R-enantiomer should match the expected value.

test_r_rotamer_cxsmiles(cxsmiles_r_rotamer_file)[source]

CXSMILES for the R-rotamer should match the expected value.

test_regression_cxsmiles(cxsmiles_normal_file)[source]

CXSMILES for a simple molecule should be deterministic across repeated calls.

test_rotamers_differ(cxsmiles_r_rotamer_file, cxsmiles_s_rotamer_file)[source]

R and S rotamers must produce different CXSMILES. Rotamers share the same SMILES core (identical connectivity) but differ in the CX coordinate extension (3D geometry).

test_s_enantiomer_cxsmiles(cxsmiles_s_enantiomer_file)[source]

CXSMILES for the S-enantiomer should match the expected value.

test_s_rotamer_cxsmiles(cxsmiles_s_rotamer_file)[source]

CXSMILES for the S-rotamer should match the expected value.

class tests.test_structures.TestChemicalFeatures[source]

Bases: object

test_more_stereochemistry_handling()[source]

Test preservation of stereochemical information with PubChem.

test_resonance_handling(gaussian_ozone_opt_outfile, gaussian_acetone_opt_outfile, gaussian_benzene_opt_outfile)[source]

Test handling of resonance structures.

test_stereochemistry_handling(methyl3hexane_molecule)[source]

Test preservation of stereochemical information.

test_volume(gaussian_ozone_opt_outfile, gaussian_acetone_opt_outfile)[source]

Test volume calculation for molecules.

Tests various volume calculation methods: - voronoi_dirichlet_occupied_volume - crude_volume_by_vdw_radii - crude_volume_by_atomic_radii - vdw_volume - vdw_volume_from_rdkit - voronoi_dirichlet_polyhedra_occupied_volume

class tests.test_structures.TestCoordinateBlock[source]

Bases: object

test_coordinate_block_with_partitions_returns_qmmm_molecule()[source]

ONIOM coordinate block should return QMMMMolecule.

test_coordinate_block_without_partitions_returns_molecule()[source]

Non-ONIOM coordinate block should return Molecule, not QMMMMolecule.

test_read_coordinate_block()[source]
test_read_gaussian_cb_frozen_atoms()[source]
test_read_gaussian_cb_with_tv()[source]
class tests.test_structures.TestCoordinateBlockAdvanced[source]

Bases: object

test_cube_file_format()[source]

Test parsing of cube file format coordinates.

test_mixed_coordinate_formats()[source]

Test parsing of mixed coordinate formats.

class tests.test_structures.TestFileHandlingAdvanced[source]

Bases: object

test_corrupted_file_handling(tmpdir)[source]

Test error handling for corrupted files.

test_large_file_handling(tmpdir)[source]

Test handling of large molecule files.

class tests.test_structures.TestGraphFeatures[source]

Bases: object

test_graph_properties()[source]

Test molecular graph properties.

test_variable_bond_cutoffs()[source]

Test bond detection with different cutoff buffers.

class tests.test_structures.TestInChIKey[source]

Bases: object

Tests for Molecule.inchikey property (Open Babel backend).

EXPECTED_LARGE_C2 = 'KRPJGRYSEYYRSW-YWQHEUOTSA-M'
EXPECTED_LARGE_C3 = 'WYLDIUSELJCHHK-MMELAICESA-M'
EXPECTED_NORMAL = 'NNJYFTBCZFRDIO-UHFFFAOYSA-N'
EXPECTED_R_ENANTIOMER = 'YDCAVENCOFCEDV-HSZRJFAPSA-N'
EXPECTED_S_ENANTIOMER = 'YDCAVENCOFCEDV-QHCPKHFHSA-N'
test_enantiomers_share_connectivity_layer(inchikey_r_enantiomer_file, inchikey_s_enantiomer_file)[source]

R and S enantiomers share the same first (connectivity) layer of the InChIKey (identical constitution) but differ in the stereo layer, confirming that Open Babel correctly resolves the axial chirality.

test_large_molecule_c2_inchikey(inchikey_large_molecule_c2_file)[source]

InChIKey for a large molecule (c2) should match the expected value.

test_large_molecule_c3_inchikey(inchikey_large_molecule_c3_file)[source]

InChIKey for a large molecule (c3) should match the expected value.

test_large_molecules_differ(inchikey_large_molecule_c3_file, inchikey_large_molecule_c2_file)[source]

Two different large molecules should produce different InChIKeys.

test_r_enantiomer_inchikey(inchikey_r_enantiomer_file)[source]

InChIKey for the R-enantiomer should match the expected value.

test_regression_inchikey(inchikey_normal_file)[source]

InChIKey for a simple small molecule should be deterministic across repeated calls.

test_s_enantiomer_inchikey(inchikey_s_enantiomer_file)[source]

InChIKey for the S-enantiomer should match the expected value.

class tests.test_structures.TestMoleculeAdvanced[source]

Bases: object

test_charge_and_multiplicity_handling()[source]

Test preservation of charge and multiplicity states.

test_convert_ase_atoms_with_constraints_to_molecule(constrained_atoms)[source]

Test conversion of ASE Atoms with constraints to Molecule.

test_distance_calculation()[source]

Test bond distance calculations.

test_empty_molecule_handling()[source]

Test edge case of empty molecule.

test_from_pdb_file_infers_uppercase_two_letter_elements_when_blank(tmpdir)[source]

Test blank PDB element columns fall back to uppercase atom-name inference.

test_from_pdb_file_preserves_atom_and_residue_metadata(tmpdir)[source]

Test native PDB import preserves atom names and residue metadata.

test_from_pdb_file_supports_model_index_selection(tmpdir)[source]

Test PDB MODEL/ENDMDL parsing and index selection.

test_frozen_atoms_manipulation()[source]

Test frozen atoms property handling.

test_infer_pdb_element_from_uppercase_atom_names()[source]

Test uppercase PDB atom names can still infer two-letter elements.

test_invalid_molecule_creation()[source]

Test error handling for invalid molecule configurations.

test_is_aromatic_non_aromatic_molecules()[source]

Regression test: non-aromatic molecules must not be reported as aromatic.

Bond-order heuristics can assign order 1.5 to bonds like O-H or Mg-I, which previously caused is_aromatic to return True for H2O and MgI2. The property must use ring membership to validate aromaticity.

test_molecule_from_db_with_pbc_and_constraints(constrained_pbc_db_file)[source]

Test creation of Molecule from database with PBC and constraints.

test_molecule_graph_generation()[source]

Test molecular graph creation with bond detection.

test_molecule_to_rdkit_conversion()[source]

Test conversion of Molecule to RDKit Mol object.

test_pbc_handling()[source]

Test periodic boundary conditions handling.

test_pdb_with_different_flavors(single_molecule_xyz_file)[source]

Test PDB conversion with different flavor options.

test_pdb_with_no_bonds(single_molecule_xyz_file)[source]

Test PDB conversion without bond detection.

test_to_ase_energy_unit_conversion()[source]

Test that to_ase() converts energy from Hartree to eV.

test_to_ase_energy_with_none_forces()[source]

Test that to_ase() converts energy when forces are None.

test_to_ase_forces_unit_conversion()[source]

Test that to_ase() converts forces from Hartree/Bohr to eV/Å.

test_to_ase_none_energy_and_forces()[source]

Test that to_ase() preserves None for energy and forces.

test_to_ase_none_energy_with_forces()[source]

Test that to_ase() converts forces when energy is None.

test_to_pdb_conversion(single_molecule_xyz_file)[source]

Test conversion of Molecule to PDB format.

test_to_pdb_strict_columns_and_final_end_record()[source]

Test strict PDB 3.3 atom-column formatting and final END line.

test_to_pdb_uses_molecule_attributes_for_chain_and_residue_metadata()[source]

Test chain/residue metadata taken directly from Molecule attributes.

test_write_generic_method_with_pdb_format(single_molecule_xyz_file, tmpdir)[source]

Test generic write() method with PDB format.

test_write_pdb_file(single_molecule_xyz_file, tmpdir)[source]

Test writing Molecule to PDB file.

test_write_pdb_rejects_unexpected_keyword_argument(single_molecule_xyz_file, tmpdir)[source]

Test write_pdb rejects unexpected kwargs instead of ignoring them.

class tests.test_structures.TestQMMMinMolecule[source]

Bases: object

test_atoms_in_levels_default_low_level(tmpdir, qmmm_written_xyz_file, qmmm_written_xyz_only_file, methyl3hexane_molecule)[source]
test_atoms_in_levels_wrong_low_level(tmpdir, methyl3hexane_molecule)[source]
test_qmmm_atoms_handling(tmpdir)[source]

Test QM/MM atoms handling.

test_qmmm_partition_out_of_range_raises()[source]

Specifying out-of-range atom indices should raise a ValueError.

test_qmmm_partition_overlap_raises()[source]

Creating a QMMMMolecule with overlapping partitions should raise a ValueError.

class tests.test_structures.TestSDFFile[source]

Bases: object

test_converts_sdf_string_to_molecule_object(tmpdir)[source]
class tests.test_structures.TestStructures[source]

Bases: object

test_molecular_geometry()[source]

Test molecular geometry calculations.

test_read_molecule_energy_from_xyz_file(xtb_optimized_xyz_file, chemsmart_generated_xyz_file, extended_xyz_file)[source]
test_read_molecule_from_multiple_molecules_xyz_file(multiple_molecules_xyz_file)[source]
test_read_molecule_from_single_molecule_xyz_file(single_molecule_xyz_file)[source]
class tests.test_structures.TestStructuresFromGaussianInput[source]

Bases: object

test_read_molecule_from_gaussian_frozen_opt(tmpdir, gaussian_frozen_opt_inputfile)[source]
test_read_molecule_from_gaussian_modred(gaussian_modred_inputfile)[source]
test_read_molecule_from_gaussian_opt_input(tmpdir, gaussian_opt_inputfile)[source]
test_read_molecule_from_gaussian_pbc(tmpdir, gaussian_pbc_1d_inputfile)[source]
test_read_molecule_from_gaussian_scan(gaussian_scan_inputfile)[source]
test_read_molecule_from_modred_gen(modred_gen_inputfile)[source]
test_read_molecule_from_modred_genecp(modred_genecp_inputfile)[source]
test_read_molecule_from_modred_genecp_custom_solvent(modred_genecp_custom_solvent_inputfile)[source]
test_read_molecule_from_opt_genecp(gaussian_opt_genecp_inputfile)[source]

tests.test_utils module

class tests.test_utils.TestDeduplicateStringKeywords[source]

Bases: object

Tests for deduplicate_string_keywords utility function.

test_args_and_bare_keyword_keeps_args_form()[source]

When keyword(args) appears before the bare keyword, keyword(args) is kept.

test_bare_and_args_keyword_keeps_args_form()[source]

When bare keyword and keyword(args) both appear, keyword(args) is kept.

test_bare_keyword_duplicate_keeps_first()[source]

When a bare keyword appears twice, the first occurrence is kept.

test_case_insensitive_matching()[source]

Matching is case-insensitive.

test_docstring_example()[source]

Reproduce the example given in the docstring.

test_empty_keywords_list_returns_unchanged()[source]

Route string is returned unchanged when keywords is an empty list.

test_empty_keywords_returns_unchanged()[source]

Route string is returned unchanged when keywords is empty.

test_empty_route_string_returns_unchanged()[source]

Empty route string is returned as-is regardless of keywords.

test_keyword_as_list()[source]

Keywords can be passed as a list.

test_keyword_as_string()[source]

A single keyword can be passed as a string.

test_keyword_as_tuple()[source]

Keywords can be passed as a tuple.

test_keyword_not_present_returns_unchanged()[source]

Route string is returned unchanged when the keyword is not present.

test_keyword_with_longer_args_preferred_over_shorter()[source]

When keyword appears twice with args, the longer args form is kept.

test_mixed_case_keyword_argument()[source]

The keyword argument itself is matched case-insensitively.

test_multiple_keywords_deduplicated()[source]

Multiple keywords are all deduplicated in one pass.

test_no_duplicates_returns_unchanged()[source]

Route string without duplicates is returned unchanged.

test_none_route_string_returns_unchanged()[source]

None route string is returned as-is.

test_three_bare_duplicates_keeps_first()[source]

When a bare keyword appears three times, only the first is kept.

test_unrelated_tokens_preserved()[source]

Tokens not in the keyword list are always preserved.

class tests.test_utils.TestGetListFromStringRange[source]

Bases: object

test_get_list_from_string()[source]
test_get_list_from_string_range()[source]
class tests.test_utils.TestIOUtilities[source]

Bases: object

test_basic_conversion(input_str, expected)[source]
test_clean_duplicate_structure()[source]
test_clean_label()[source]
test_conversion_strips_whitespace()[source]
test_create_molecule_list()[source]
test_header_like_then_data_like()[source]
test_line_of_all_integers(line, allow_sign, expected)[source]
test_line_of_integer_followed_by_floats(line, expected)[source]
test_raises_value_error_on_empty_or_invalid_input(bad_input)[source]
test_reject_plain_ints_as_floats()[source]
test_trailing_and_leading_spaces()[source]
test_trailing_comma_is_ignored()[source]
class tests.test_utils.TestNaturallySorted[source]

Bases: object

test_alphanumeric()[source]

Test sorting alphanumeric strings.

test_empty_list()[source]

Test sorting an empty list.

test_file_names()[source]

Test sorting typical file names.

test_large_numbers()[source]

Test sorting with large numbers.

test_mixed_case()[source]

Test sorting with mixed case letters.

test_mixed_types()[source]

Test sorting with mixed formats (numbers, letters, and empty strings).

test_no_numbers()[source]

Test sorting strings without numbers.

test_numeric_order()[source]

Test sorting strings with numbers in natural order.

test_single_item()[source]

Test sorting a list with one item.

test_special_characters()[source]

Test sorting with special characters.

class tests.test_utils.TestParseIndexSpecification[source]

Bases: object

Tests for the new unified parse_index_specification function.

test_ase_style_single_indices()[source]

Test ASE-style single index specifications.

test_ase_style_slices()[source]

Test ASE-style slice specifications.

test_boundary_checking_enabled()[source]

Test boundary checking when allow_out_of_range=False.

test_duplicate_detection_enabled()[source]

Test duplicate detection when allow_duplicates=False.

test_free_format_comma_separated()[source]

Test free-format comma-separated specifications.

test_free_format_hyphen_ranges()[source]

Test free-format hyphen-based range specifications.

test_free_format_mixed()[source]

Test free-format mixed specifications.

test_free_format_with_negative_indices()[source]

Test free-format with negative indices.

test_invalid_inputs()[source]

Test that invalid inputs raise ValueError.

test_parse_index_boundary_detection_disabled()[source]

Test boundary detection when allow_out_of_range=False.

test_parse_index_boundary_detection_enabled()[source]

Test boundary detection when allow_out_of_range=True.

test_parse_index_duplicate_detection_disabled()[source]

Test duplicate detection when allow_duplicates=False.

test_parse_index_duplicate_detection_enabled()[source]

Test duplicate detection when allow_duplicates=True.

test_with_actual_lists()[source]

Test parse_index_specification with actual list indexing.

class tests.test_utils.TestReturnObjectsAndIndicesFromStringIndex[source]

Bases: object

Tests for the return_objects_and_indices_from_string_index utility function.

test_empty_list_raises_index_error()[source]

Test that accessing empty list raises IndexError.

test_index_zero_raises_value_error()[source]

Test that index 0 raises ValueError (1-based indexing required).

test_out_of_range_raises_index_error()[source]

Test that out-of-range index raises IndexError.

test_range_with_brackets()[source]

Test user-defined range with brackets.

test_single_index_last()[source]

Test single index at end of list.

test_single_index_middle()[source]

Test single index in middle of list.

test_single_index_string()[source]

Test single index as a string (1-based).

test_single_negative_index()[source]

Test negative index (last item).

test_slice_all()[source]

Test slice selecting all elements using ‘:’.

test_slice_from_beginning()[source]

Test slice from beginning to index.

test_slice_from_start()[source]

Test slice from beginning.

test_slice_range()[source]

Test slice with start and stop (1-based, exclusive stop).

test_slice_to_end()[source]

Test slice to end using open-ended slice.

test_slice_with_step()[source]

Test slice with step parameter.

test_specified_indices_5_to_8()[source]

Test that specified indices are preserved (e.g., 5:8 gives indices 5,6,7).

test_user_defined_range()[source]

Test user-defined range format (comma-separated).

test_user_defined_range_complex()[source]

Test complex user-defined range.

test_user_defined_range_with_hyphen()[source]

Test user-defined range with hyphen notation.

test_with_integer_objects()[source]

Test with list of integers as objects.

test_with_mixed_objects()[source]

Test with list of mixed types as objects.

class tests.test_utils.TestRunCommand[source]

Bases: object

Tests for the run_command utility function.

test_command_exception(mock_popen, capture_log)[source]

Test handling an exception during command execution.

test_command_failure(mock_popen, capture_log)[source]

Test running a command that fails with non-zero return code.

test_invalid_input_type(capture_log)[source]

Test handling invalid input type (neither string nor list).

test_list_command_success(mock_popen)[source]

Test running a command provided as a list with successful execution.

test_string_command_success(mock_popen)[source]

Test running a command provided as a string with successful execution.

test_string_command_with_quotes(mock_popen)[source]

Test running a string command with quoted arguments.

class tests.test_utils.TestString2Index1Based[source]

Bases: object

test_invalid_inputs()[source]
test_open_ended_slice()[source]
test_single_integer()[source]
test_slice()[source]
test_slice_with_step()[source]
class tests.test_utils.TestUtils[source]

Bases: object

test_cmp_with_ignore_list(gaussian_written_opt_file, gaussian_written_opt_file_with_route)[source]
test_cmp_with_ignore_string(gaussian_written_sp_from_nhc_singlet_log_with_custom_basis_from_api_file, gaussian_written_sp_from_nhc_singlet_log_with_custom_basis_from_api_file_v2)[source]
test_content_blocking(gaussian_opt_inputfile)[source]
test_get_indices_from_string()[source]

Test the conversion of string indices to a list of integers; 1-based indices.

test_get_list_from_string_range()[source]
test_get_range_from_list()[source]
test_is_float()[source]
test_iterative_compare_list_of_dicts()[source]
test_iterative_compare_list_of_elements()[source]
test_iterative_compare_list_of_lists()[source]
test_iterative_compare_list_of_string()[source]
test_iterative_compare_list_of_tuples()[source]

Module contents