Skip to content

Commit

Permalink
Add test for raised exception text in DSSP
Browse files Browse the repository at this point in the history
  • Loading branch information
marinegor committed Jul 24, 2024
1 parent 46ec401 commit ba4cb02
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions testsuite/MDAnalysisTests/analysis/test_dssp.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,15 @@ def test_trajectory_with_uneven_number_of_atoms_fails(pdb_filename):
u = mda.Universe(pdb_filename)
with pytest.raises(ValueError):
DSSP(u, guess_hydrogens=True).run()


@pytest.mark.parametrize(
"pdb_filename", glob.glob(f"{DSSP_FOLDER}/wrong_hydrogens.pdb.gz")
)
def test_exception_raises_with_atom_index(pdb_filename):
u = mda.Universe(pdb_filename)
with pytest.raises(
ValueError,
match="Residue <Residue SER, 298> contains*",
):
DSSP(u, guess_hydrogens=False).run()
Binary file not shown.

0 comments on commit ba4cb02

Please sign in to comment.