Beispiel #1
0
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)
Beispiel #2
0
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)
Beispiel #3
0
def test_transpose_empty():
    table1 = (('id', 'colour'),)
    table2 = transpose(table1)
    expect2 = (('id',),
               ('colour',))
    ieq(expect2, table2)