From 39ec61a5d3580331a9d38d9f5e25adeacbcd2606 Mon Sep 17 00:00:00 2001 From: Adebisi Adeyemi <84504391+adebisi4145@users.noreply.github.com> Date: Fri, 18 Oct 2024 08:03:35 +0000 Subject: [PATCH] add negative test for the _is_inchikey method in CompoundIdentifier class --- test/test_compound_identifier.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/test_compound_identifier.py b/test/test_compound_identifier.py index 1fd696fae..5fe293486 100644 --- a/test/test_compound_identifier.py +++ b/test/test_compound_identifier.py @@ -13,4 +13,15 @@ def test_is_input_header_positive(compound_identifier, header): @pytest.mark.parametrize("header", ["key", "inchiKey", "KEY", "INCHIKEY"]) def test_is_key_header_positive(compound_identifier, header): """Test that valid key headers return True.""" - assert compound_identifier.is_key_header(header) is True \ No newline at end of file + assert compound_identifier.is_key_header(header) is True + +@pytest.mark.parametrize("inchikey", [ + "BSYNRYMUTXBXSQUHFFFAOYSA", + "BSYNRYMUTXBXSQ-UHFFFAOYSA-XY", + "12345678901234-1234567890-X", + "BSYNRYMUTXBXSQ_UHFFFAOYSA-N", + "BSYNRYMUTXBXSQ-UHFFFAOYSA" +]) +def test_is_inchikey_negative(compound_identifier, inchikey): + """Test that invalid InChIKeys return False.""" + assert not compound_identifier._is_inchikey(inchikey) \ No newline at end of file