def test_transpose(): table1 = (('id', 'colour'), (1, 'blue'), (2, 'red'), (3, 'purple'), (5, 'yellow'), (7, 'orange')) table2 = transpose(table1) expect2 = (('id', 1, 2, 3, 5, 7), ('colour', 'blue', 'red', 'purple', 'yellow', 'orange')) ieq(expect2, table2) ieq(expect2, table2)
def test_transpose_empty(): table1 = (('id', 'colour'),) table2 = transpose(table1) expect2 = (('id',), ('colour',)) ieq(expect2, table2)