def test_skip(): table1 = (("#aaa", "bbb", "ccc"), ("#mmm",), ("foo", "bar"), ("a", 1), ("b", 2)) table2 = skip(table1, 2) expect2 = (("foo", "bar"), ("a", 1), ("b", 2)) ieq(expect2, table2) ieq(expect2, table2) # can iterate twice?
def test_skip_empty(): table1 = (('#aaa', 'bbb', 'ccc'), ('#mmm',), ('foo', 'bar')) table2 = skip(table1, 2) expect2 = (('foo', 'bar'),) ieq(expect2, table2)
def test_skip(): table1 = (('#aaa', 'bbb', 'ccc'), ('#mmm', ), ('foo', 'bar'), ('a', 1), ('b', 2)) table2 = skip(table1, 2) expect2 = (('foo', 'bar'), ('a', 1), ('b', 2)) ieq(expect2, table2) ieq(expect2, table2) # can iterate twice?
def _build_schema_from_values(table, sample): # table2: try not advance iterators samples, table2 = iterpeek(table, sample + 1) props = fieldnames(samples) peek = skip(samples, 1) schema_fields = _build_schema_fields_from_values(peek, props) schema_source = _build_schema_with(schema_fields) return schema_source, table2
def test_skip(): table1 = (('#aaa', 'bbb', 'ccc'), ('#mmm',), ('foo', 'bar'), ('a', 1), ('b', 2)) table2 = skip(table1, 2) expect2 = (('foo', 'bar'), ('a', 1), ('b', 2)) ieq(expect2, table2) ieq(expect2, table2) # can iterate twice?
def test_skip_empty(): table1 = (("#aaa", "bbb", "ccc"), ("#mmm",), ("foo", "bar")) table2 = skip(table1, 2) expect2 = (("foo", "bar"),) ieq(expect2, table2)