11import unittest
22from unittest .mock import PropertyMock , mock_open , patch
3+
34from chebai .preprocessing .datasets .protein_pretraining import _ProteinPretrainingData
45from chebai .preprocessing .reader import ProteinDataReader
56from tests .unit .mock_data .ontology_mock_data import GOUniProtMockData
@@ -41,7 +42,9 @@ def setUpClass(
4142 new_callable = mock_open ,
4243 read_data = GOUniProtMockData .get_UniProt_raw_data (),
4344 )
44- def test_parse_protein_data_for_pretraining (self , mock_open_file : mock_open ) -> None :
45+ def test_parse_protein_data_for_pretraining (
46+ self , mock_open_file : mock_open
47+ ) -> None :
4548 """
4649 Tests the _parse_protein_data_for_pretraining method.
4750
@@ -55,15 +58,15 @@ def test_parse_protein_data_for_pretraining(self, mock_open_file: mock_open) ->
5558
5659 # Assert that all expected Swiss-Prot IDs are present in the DataFrame
5760 self .assertEqual (
58- set (pretrain_df [' swiss_id' ]),
61+ set (pretrain_df [" swiss_id" ]),
5962 set (list_of_pretrain_swiss_ids ),
60- msg = "The parsed DataFrame does not contain the expected Swiss-Prot IDs for pretraining."
63+ msg = "The parsed DataFrame does not contain the expected Swiss-Prot IDs for pretraining." ,
6164 )
6265
6366 # Assert that all sequences are not empty
6467 self .assertTrue (
65- pretrain_df [' sequence' ].str .len ().gt (0 ).all (),
66- msg = "Some protein sequences in the pretraining DataFrame are empty."
68+ pretrain_df [" sequence" ].str .len ().gt (0 ).all (),
69+ msg = "Some protein sequences in the pretraining DataFrame are empty." ,
6770 )
6871
6972
0 commit comments