示例#1
0
def test_subjects_not_in_df_list():
    assert not ('02' in pydst.Dst().get_subjects(
        subjects=['02', '05'])['id'].values)
示例#2
0
def test_int_subject():
    with pytest.raises(ValueError):
        pydst.Dst().get_subjects(subjects=2)
示例#3
0
def test_list_multiple_elements_subject():
    assert isinstance(pydst.Dst().get_subjects(subjects=['02', '05']),
                      DataFrame)
示例#4
0
def test_subjects_not_in_df():
    assert not ('02' in pydst.Dst().get_subjects(subjects='02')['id'].values)
示例#5
0
def test_subject_has_subsubjects():
    id = pydst.Dst().get_subjects()['id'][0]
    assert isinstance(pydst.Dst().get_subjects(subjects=id), DataFrame)
示例#6
0
def test_list_single_element_subject():
    assert isinstance(pydst.Dst().get_subjects(subjects=['02']), DataFrame)
示例#7
0
def test_existence_lang_attribute_default():
    assert 'en' == pydst.Dst().lang
示例#8
0
def test_lang_error_tables():
    with pytest.raises(ValueError):
        pydst.Dst().get_tables(lang='fi')
示例#9
0
def test_nonexistence_lang_error_dst():
    with pytest.raises(ValueError):
        pydst.Dst(lang='es')
示例#10
0
def test_existence_lang_attribute():
    assert 'da' == pydst.Dst('da').lang
示例#11
0
def test_get_tables_can_filter():
    assert pydst.Dst().get_tables(
        subjects=['02']).shape != pydst.Dst().get_tables().shape
示例#12
0
def test_inactive_tables_if_true():
    assert pydst.Dst().get_tables(inactive_tables=True).active.all() == False
示例#13
0
def test_no_inactive_tables_if_false():
    assert pydst.Dst().get_tables().active.all()
示例#14
0
def test_lang_error_subject():
    with pytest.raises(ValueError):
        pydst.Dst().get_subjects(lang='fi')
示例#15
0
def test_subjects_returns_df():
    assert isinstance(pydst.Dst().get_subjects(), DataFrame)
示例#16
0
def test_str_tables():
    assert isinstance(pydst.Dst().get_tables(subjects='02'), DataFrame)
示例#17
0
def test_int_include_inactive_get_tables():
    with pytest.raises(ValueError):
        pydst.Dst().get_tables(inactive_tables=2)