From a8abd436d671e0d72c58e97a9b0014ce79970938 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Tue, 19 Sep 2023 11:39:11 -0700 Subject: [PATCH] Fix mock of class method --- modules/mmcif/test/test_data.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/mmcif/test/test_data.py b/modules/mmcif/test/test_data.py index 814285ec93..059e880a02 100644 --- a/modules/mmcif/test/test_data.py +++ b/modules/mmcif/test/test_data.py @@ -11,14 +11,14 @@ def mocked_ihm_from_accession(): """Prevent ihm.reference.UniProtSequence.from_accession from accessing the network""" - def mock_from_acc(accession): - return ihm.reference.UniProtSequence(db_code='CSN1_HUMAN', - accession='Q13098', - sequence='someseq') + def mock_from_acc(cls, accession): + return cls(db_code='CSN1_HUMAN', accession='Q13098', + sequence='someseq') orig_meth = ihm.reference.UniProtSequence.from_accession try: - ihm.reference.UniProtSequence.from_accession = mock_from_acc + ihm.reference.UniProtSequence.from_accession = classmethod( + mock_from_acc) yield finally: ihm.reference.UniProtSequence.from_accession = orig_meth