Example #1
0
def test_selectin():

    table = (('foo', 'bar', 'baz'), ('a', 4, 9.3), ('a', 2, 88.2),
             ('b', 1, 23.3), ('c', 8, 42.0), ('d', 7, 100.9), ('c', 2))

    actual = selectin(table, 'foo', ['a', 'x', 'y'])
    expect = (('foo', 'bar', 'baz'), ('a', 4, 9.3), ('a', 2, 88.2))
    ieq(expect, actual)
    ieq(expect, actual)  # check can iterate twice
Example #2
0
def test_selectin():
    
    table = (('foo', 'bar', 'baz'),
             ('a', 4, 9.3),
             ('a', 2, 88.2),
             ('b', 1, 23.3),
             ('c', 8, 42.0),
             ('d', 7, 100.9),
             ('c', 2))

    actual = selectin(table, 'foo', ['a', 'x', 'y'])
    expect = (('foo', 'bar', 'baz'),
              ('a', 4, 9.3),
              ('a', 2, 88.2))
    ieq(expect, actual)
    ieq(expect, actual)  # check can iterate twice
Example #3
0
def test_selectin():

    table = (
        ("foo", "bar", "baz"),
        ("a", 4, 9.3),
        ("a", 2, 88.2),
        ("b", 1, 23.3),
        ("c", 8, 42.0),
        ("d", 7, 100.9),
        ("c", 2),
    )

    actual = selectin(table, "foo", ["a", "x", "y"])
    expect = (("foo", "bar", "baz"), ("a", 4, 9.3), ("a", 2, 88.2))
    ieq(expect, actual)
    ieq(expect, actual)  # check can iterate twice