def test_sort(table1): """Tests row and column by name""" assert t.column(t.select(t.sort(table1, "kpi"), "kpi2"), 0)[0] == 51234123 assert t.column( t.select( t.sort(table1, "kpi", ascending=False), "kpi2"), 0)[0] == 101234123
def test_relabel(table1): """Tests relabel column by name, multiple select""" t2 = t.relabel(table1,"kpi", "bacalhau") assert t.column(t.select(t2, "bacalhau", "isLabel"), "bacalhau")[0] == 5 assert t.column(t.select(t2, "bacalhau", "isLabel"), "isLabel")[0] == 0
def test_where2(table1): """Tests where and column by index""" assert t.column(t.where(table1, "kpi", 11, op.ne), 0)[0] == 'k'
def test_where3(table1): """Tests where and column by index""" assert t.column(t.where(table1, "kpi", 9, op.gt), 0)[0] == 'j'
def test_select(table1): """Tests select and column by index""" assert t.column(t.select(table1, "kpi"), 0)[0] == 5