[6ff4a8]: / tests / utils / test_utils_data.py

Download this file

40 lines (31 with data), 1.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from typing import Literal
import pytest
import numpy as np
from moscot.utils.data import (
apoptosis_markers,
proliferation_markers,
transcription_factors,
)
class TestTranscriptionFactor:
@pytest.mark.parametrize("organism", ["human", "mouse", "drosophila"])
def test_load_data(self, organism: Literal["human", "mouse", "drosophila"]):
tfs = transcription_factors(organism=organism)
assert isinstance(tfs, list)
assert len(tfs) > 0
is_str = [isinstance(el, str) for el in tfs]
assert np.sum(is_str) == len(tfs)
class TestMarkerGenes:
@pytest.mark.parametrize("organism", ["human", "mouse"])
def test_proliferation_markers(self, organism: Literal["human", "mouse"]):
mgs = proliferation_markers(organism=organism)
assert isinstance(mgs, list)
assert len(mgs) > 0
is_str = [isinstance(el, str) for el in mgs]
assert np.sum(is_str) == len(mgs)
@pytest.mark.parametrize("organism", ["human", "mouse"])
def test_apoptosis_markers(self, organism: Literal["human", "mouse"]):
mgs = apoptosis_markers(organism=organism)
assert isinstance(mgs, list)
assert len(mgs) > 0
is_str = [isinstance(el, str) for el in mgs]
assert np.sum(is_str) == len(mgs)