Skip to content

Commit

Permalink
Parametrized csviwer testing code.
Browse files Browse the repository at this point in the history
  • Loading branch information
smelandr committed Apr 12, 2017
1 parent 816dba1 commit 70271ac
Showing 1 changed file with 13 additions and 42 deletions.
55 changes: 13 additions & 42 deletions tests/test_csviewer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import shutil
import os
import shutil
import pytest

from nmrstarlib.csviewer import CSViewer


Expand All @@ -10,55 +12,24 @@ def teardown_module(module):
shutil.rmtree("tests/example_data/NMRSTAR2/tmp")


def test_csviewer_all():
@pytest.mark.parametrize("amino_acids,atoms", [
(None, None),
(["SER", "MET"], None),
(["SER", "MET"], ["CA", "CB"])
])
def test_csviewer(amino_acids, atoms):
csviewer = CSViewer(from_path="tests/example_data/NMRSTAR3/bmr18569.str",
amino_acids=(),
atoms=(),
amino_acids=amino_acids,
atoms=atoms,
filename="tests/example_data/NMRSTAR3/tmp/18569",
csview_format="png",
nmrstar_version="3")
csviewer.csview(view=False)

csviewer = CSViewer(from_path="tests/example_data/NMRSTAR2/bmr18569.str",
amino_acids=(),
atoms=(),
amino_acids=amino_acids,
atoms=atoms,
filename="tests/example_data/NMRSTAR2/tmp/18569",
csview_format="png",
nmrstar_version="2")
csviewer.csview(view=False)


def test_csviewer_specific_amino_acid():
csviewer = CSViewer(from_path="tests/example_data/NMRSTAR3/bmr18569.str",
amino_acids=("SER",),
atoms=(),
filename="tests/example_data/NMRSTAR3/tmp/18569_SER",
csview_format="png",
nmrstar_version="3")
csviewer.csview(view=False)

csviewer = CSViewer(from_path="tests/example_data/NMRSTAR2/bmr18569.str",
amino_acids=("SER",),
atoms=(),
filename="tests/example_data/NMRSTAR2/tmp/18569_SER",
csview_format="png",
nmrstar_version="2")
csviewer.csview(view=False)


def test_csviewer_specific_amino_acid_specific_atom():
csviewer = CSViewer(from_path="tests/example_data/NMRSTAR3/bmr18569.str",
amino_acids=("SER",),
atoms=("CA", "CB"),
filename="tests/example_data/NMRSTAR3/tmp/18569_SER_CA_CB",
csview_format="png",
nmrstar_version="3")
csviewer.csview(view=False)

csviewer = CSViewer(from_path="tests/example_data/NMRSTAR2/bmr18569.str",
amino_acids=("SER",),
atoms=("CA", "CB"),
filename="tests/example_data/NMRSTAR2/tmp/18569_SER_CA_CB",
csview_format="png",
nmrstar_version="2")
csviewer.csview(view=False)

0 comments on commit 70271ac

Please sign in to comment.