from boo.columns import SHORT_COLUMNS, Converter, CONVERTER_FUNC, TTL_COLUMNS


def test_sc_all():
    assert SHORT_COLUMNS.all == [
        'name',
        'okpo',
        'okopf',
        'okfs',
        'okved',
        'inn',
        'unit',
        'report_type',
        'of',
        'of_lag',
        'ta_fix',
        'ta_fix_lag',
        'cash',
        'cash_lag',
        'ta_nonfix',
        'ta_nonfix_lag',
        'ta',
        'ta_lag',
        'tp_capital',
        'tp_capital_lag',
        'debt_long',
        'debt_long_lag',
        'tp_long',
        'tp_long_lag',
        'debt_short',
        'debt_short_lag',
        'tp_short',
        'tp_short_lag',
        'tp',
        'tp_lag',
        'sales',
        'sales_lag',
        'profit_oper',
        'profit_oper_lag',
        'exp_interest',
        'exp_interest_lag',
        'profit_before_tax',
        'profit_before_tax_lag',
        'profit_after_tax',
        'profit_after_tax_lag',
        'cf_oper_in',
        'cf_oper_in_sales',
        'cf_oper_out',
        'paid_to_supplier',
        'paid_to_worker',
        'paid_interest',
        'paid_profit_tax',
        'paid_other_costs',
        'cf_oper',
        'cf_inv_in',
        'cf_inv_out',
        'paid_fa_investment',
        'cf_inv',
        'cf_fin_in',
        'cf_fin_out',
        'cf_fin',
        'cf',
        'date_published']


def test_sc_numeric():
    assert SHORT_COLUMNS.numeric == [
        'of',
        'of_lag',
        'ta_fix',
        'ta_fix_lag',
        'cash',
        'cash_lag',
        'ta_nonfix',
        'ta_nonfix_lag',
        'ta',
        'ta_lag',
        'tp_capital',
        'tp_capital_lag',
        'debt_long',
        'debt_long_lag',
        'tp_long',
        'tp_long_lag',
        'debt_short',
        'debt_short_lag',
        'tp_short',
        'tp_short_lag',
        'tp',
        'tp_lag',
        'sales',
        'sales_lag',
        'profit_oper',
        'profit_oper_lag',
        'exp_interest',
        'exp_interest_lag',
        'profit_before_tax',
        'profit_before_tax_lag',
        'profit_after_tax',
        'profit_after_tax_lag',
        'cf_oper_in',
        'cf_oper_in_sales',
        'cf_oper_out',
        'paid_to_supplier',
        'paid_to_worker',
        'paid_interest',
        'paid_profit_tax',
        'paid_other_costs',
        'cf_oper',
        'cf_inv_in',
        'cf_inv_out',
        'paid_fa_investment',
        'cf_inv',
        'cf_fin_in',
        'cf_fin_out',
        'cf_fin',
        'cf']


def test_sc_text():
    assert SHORT_COLUMNS.text == [
        'name',
        'okpo',
        'okopf',
        'okfs',
        'okved',
        'inn',
        'unit',
        'report_type',
        'date_published']


def test_converter_class_pass_through():
    v = Converter()
    already_short = CONVERTER_FUNC(TTL_COLUMNS)
    assert SHORT_COLUMNS.all == v.short_columns(already_short).all
