Skip to content
Snippets Groups Projects
Verified Commit 80fcb5a0 authored by Xavier Robin's avatar Xavier Robin
Browse files

feat: SCHWED-5783 ensure is_ligand is set properly upon Copy()

parent 23939b51
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,8 @@ class TestLigandScoring(unittest.TestCase): ...@@ -23,6 +23,8 @@ class TestLigandScoring(unittest.TestCase):
assert len(sc.target_ligands) == 7 assert len(sc.target_ligands) == 7
assert len(sc.model_ligands) == 1 assert len(sc.model_ligands) == 1
assert len([r for r in sc.target.residues if r.is_ligand]) == 7
assert len([r for r in sc.model.residues if r.is_ligand]) == 1
def test_init_given_ligands(self): def test_init_given_ligands(self):
"""Test that we can instantiate the scorer with ligands contained in """Test that we can instantiate the scorer with ligands contained in
...@@ -38,6 +40,9 @@ class TestLigandScoring(unittest.TestCase): ...@@ -38,6 +40,9 @@ class TestLigandScoring(unittest.TestCase):
assert len(sc.target_ligands) == 4 assert len(sc.target_ligands) == 4
assert len(sc.model_ligands) == 1 assert len(sc.model_ligands) == 1
# IsLigand flag should still be set even on not selected ligands
assert len([r for r in sc.target.residues if r.is_ligand]) == 7
assert len([r for r in sc.model.residues if r.is_ligand]) == 1
# Ensure the residues are not copied # Ensure the residues are not copied
assert len(sc.target.Select("rname=MG").residues) == 2 assert len(sc.target.Select("rname=MG").residues) == 2
...@@ -83,6 +88,9 @@ class TestLigandScoring(unittest.TestCase): ...@@ -83,6 +88,9 @@ class TestLigandScoring(unittest.TestCase):
assert len(sc.target_ligands) == 7 assert len(sc.target_ligands) == 7
assert len(sc.model_ligands) == 1 assert len(sc.model_ligands) == 1
# Ensure we set the is_ligand flag
assert len([r for r in sc.target.residues if r.is_ligand]) == 7
assert len([r for r in sc.model.residues if r.is_ligand]) == 1
# Pass residues # Pass residues
mdl_ligs_res = [mdl_ligs[0].residues[0]] mdl_ligs_res = [mdl_ligs[0].residues[0]]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment