def test_namedtuples_unevenrows(): table = (('foo', 'bar'), ('a', 1, True), ('b', )) actual = namedtuples(table) it = iter(actual) o = next(it) eq_('a', o.foo) eq_(1, o.bar) o = next(it) eq_('b', o.foo) eq_(None, o.bar)
def test_namedtuples_unevenrows(): table = (('foo', 'bar'), ('a', 1, True), ('b',)) actual = namedtuples(table) it = iter(actual) o = next(it) eq_('a', o.foo) eq_(1, o.bar) o = next(it) eq_('b', o.foo) eq_(None, o.bar)
def test_namedtuples(): table = (('foo', 'bar'), ('a', 1), ('b', 2)) actual = namedtuples(table) it = iter(actual) o = next(it) eq_('a', o.foo) eq_(1, o.bar) o = next(it) eq_('b', o.foo) eq_(2, o.bar)