Skip to content

Commit

Permalink
Add basic no-error test for expressionset plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
caiw committed Mar 1, 2024
1 parent 171fabb commit 77f58f5
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/test_plotting.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from pathlib import Path

from numpy import array, array_equal

from kymata.plot.plot import _get_best_ylim, _MAJOR_TICK_SIZE, _get_yticks, _get_xticks
from kymata.datasets.sample import delete_dataset
from kymata.plot.plot import _get_best_ylim, _MAJOR_TICK_SIZE, _get_yticks, _get_xticks, expression_plot


def test_best_best_ylim_returns_supplied_ylim():
Expand Down Expand Up @@ -35,3 +38,18 @@ def test_get_x_ticks_smaller():
def test_get_x_ticks_non_multiples():
x_ticks = _get_xticks((-150, 750))
assert array_equal(x_ticks, array([-100, 0, 100, 200, 300, 400, 500, 600, 700]))


def test_expression_plot_no_error():
from kymata.datasets.sample import TVLInsLoudnessOnlyDataset
dataset = TVLInsLoudnessOnlyDataset(download=False)
try:
dataset.download()

expression_plot(dataset.to_expressionset())

finally:
delete_dataset(dataset)
for filename in dataset.filenames:
assert not Path(dataset.path, filename).exists()

0 comments on commit 77f58f5

Please sign in to comment.