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