-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_mv_data_mine.py
34 lines (24 loc) · 1.28 KB
/
test_mv_data_mine.py
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
from hypothesis import given, strategies as st
from unittest import mock
from typing import List, Dict
import pytest
@given(data_list=st.from_type(List[str]), taxa_rank=st.characters())
def test_build_dict(cls_mv_data_mine, data_list, taxa_rank):
output_dict = cls_mv_data_mine._build_dict(data_list, taxa_rank)
assert isinstance(output_dict, dict)
@pytest.mark.parametrize('text_type', ['abstract', 'text'])
def test_mv_data_mine(cls_mv_data_mine, tab_df_merged, text_type):
texts, pmids = cls_mv_data_mine.get_data(tab_df_merged, text_type)
assert isinstance(texts, list)
@pytest.mark.parametrize('text_type', ['abstract', 'text'])
def test_mv_data_mine_2(cls_mv_data_mine, tab_df_merged, text_type):
texts, pmids = cls_mv_data_mine.get_data(tab_df_merged, text_type)
assert isinstance(pmids, list)
@pytest.mark.parametrize('text_type', ['abstract', 'text'])
def test_mv_data_mine_3(cls_mv_data_mine, tab_df_merged, text_type):
texts, pmids = cls_mv_data_mine.get_data(tab_df_merged, text_type)
assert isinstance(texts[0], str)
@pytest.mark.parametrize('text_type', ['abstract', 'text'])
def test_mv_data_mine_4(cls_mv_data_mine, tab_df_merged, text_type):
texts, pmids = cls_mv_data_mine.get_data(tab_df_merged, text_type)
assert isinstance(pmids[0], int)