From 3f35a33b5a3d11fd7189dd756c74a6033a9527c1 Mon Sep 17 00:00:00 2001 From: kmlefran Date: Thu, 18 Jan 2024 15:55:44 -0500 Subject: [PATCH] Update tests --- tests/test_subproptools.py | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tests/test_subproptools.py b/tests/test_subproptools.py index f7eb479..9ee08e5 100644 --- a/tests/test_subproptools.py +++ b/tests/test_subproptools.py @@ -104,7 +104,7 @@ def test_get_atom_vscc(filepath_tests): filepath_tests / "test_data" / "SubH_NHOCH3_wb97xd_aug-cc-pvtz_reor_atomicfiles" - / "O4.agpviz" + / "o4.agpviz" ) with open(file_with_relpath, encoding="utf-8") as f: data = f.readlines() @@ -126,7 +126,7 @@ def test_get_sub_props(filepath_tests): sub_props = qt.get_sub_props( atomic_properties, [1, 3, 4, 5, 6, 7, 8], - ["N1", "H3", "O4", "C5", "H6", "H7", "H8"], + ["N1", "H2", "H3", "O4", "C5", "H6", "H7", "H8"], ) assert isinstance(sub_props, dict) @@ -144,7 +144,7 @@ def test_extract_sub_props(filepath_tests): + "test_data" + "/" + "SubH_NHOCH3_wb97xd_aug-cc-pvtz_reor", - lapRhoCpAtoms=["O4"], + lapRhoCpAtoms=[4], ) assert isinstance(sub_props, dict) assert "Group" in sub_props @@ -174,6 +174,28 @@ def test_extract_requested_cc_props(filepath_tests): assert len(vscc_props["O4"]) == 3 +def test_get_selected_bcps(filepath_tests): + """Test get_selected_bcps""" + data = load_sumfile( + filepath_tests, filename="SubH_NHOCH3_wb97xd_aug-cc-pvtz_reor.sum" + ) + bcp_dict = qt.get_selected_bcps(data, [["N1", "H2"], ["N1", "H3"]]) + assert isinstance(bcp_dict, dict) + assert len(bcp_dict) == 2 + assert "N1-H2" in bcp_dict + assert "N1-H3" in bcp_dict + + +def test_find_connected(filepath_tests): + """Test find_connected""" + data = load_sumfile( + filepath_tests, filename="SubH_NHOCH3_wb97xd_aug-cc-pvtz_reor.sum" + ) + con = qt.find_connected(data, "H2", "N1") + assert isinstance(con, list) + assert len(con) == 2 + + def test_extract_requested_bcp_props(filepath_tests): """Test extract_requested_bcp_props""" data = load_sumfile(