def test_unflatten(): table1 = (('lines',), ('A',), (1,), (True,), ('C',), (7,), (False,), ('B',), (2,), (False,), ('C',), (9,)) expect1 = (('f0', 'f1', 'f2'), ('A', 1, True), ('C', 7, False), ('B', 2, False), ('C', 9, None)) actual1 = unflatten(table1, 'lines', 3) ieq(expect1, actual1) ieq(expect1, actual1)
def test_unflatten_empty(): table1 = (('lines',),) expect1 = (('f0', 'f1', 'f2'),) actual1 = unflatten(table1, 'lines', 3) print list(actual1) ieq(expect1, actual1)
def test_unflatten_empty(): table1 = (('lines', ), ) expect1 = (('f0', 'f1', 'f2'), ) actual1 = unflatten(table1, 'lines', 3) print list(actual1) ieq(expect1, actual1)
def test_unflatten_2(): inpt = ('A', 1, True, 'C', 7, False, 'B', 2, False, 'C', 9) expect1 = (('f0', 'f1', 'f2'), ('A', 1, True), ('C', 7, False), ('B', 2, False), ('C', 9, None)) actual1 = unflatten(inpt, 3) ieq(expect1, actual1) ieq(expect1, actual1)