def test_subjects_not_in_df_list(): assert not ('02' in pydst.Dst().get_subjects( subjects=['02', '05'])['id'].values)
def test_int_subject(): with pytest.raises(ValueError): pydst.Dst().get_subjects(subjects=2)
def test_list_multiple_elements_subject(): assert isinstance(pydst.Dst().get_subjects(subjects=['02', '05']), DataFrame)
def test_subjects_not_in_df(): assert not ('02' in pydst.Dst().get_subjects(subjects='02')['id'].values)
def test_subject_has_subsubjects(): id = pydst.Dst().get_subjects()['id'][0] assert isinstance(pydst.Dst().get_subjects(subjects=id), DataFrame)
def test_list_single_element_subject(): assert isinstance(pydst.Dst().get_subjects(subjects=['02']), DataFrame)
def test_existence_lang_attribute_default(): assert 'en' == pydst.Dst().lang
def test_lang_error_tables(): with pytest.raises(ValueError): pydst.Dst().get_tables(lang='fi')
def test_nonexistence_lang_error_dst(): with pytest.raises(ValueError): pydst.Dst(lang='es')
def test_existence_lang_attribute(): assert 'da' == pydst.Dst('da').lang
def test_get_tables_can_filter(): assert pydst.Dst().get_tables( subjects=['02']).shape != pydst.Dst().get_tables().shape
def test_inactive_tables_if_true(): assert pydst.Dst().get_tables(inactive_tables=True).active.all() == False
def test_no_inactive_tables_if_false(): assert pydst.Dst().get_tables().active.all()
def test_lang_error_subject(): with pytest.raises(ValueError): pydst.Dst().get_subjects(lang='fi')
def test_subjects_returns_df(): assert isinstance(pydst.Dst().get_subjects(), DataFrame)
def test_str_tables(): assert isinstance(pydst.Dst().get_tables(subjects='02'), DataFrame)
def test_int_include_inactive_get_tables(): with pytest.raises(ValueError): pydst.Dst().get_tables(inactive_tables=2)