

def test_select_rewrite_ord_literals(self):
    'Test rewrite selection for ordered with literals'
    l = ast.Literal('foo')
    v = ast.Literal('bar')
    v2 = ast.Literal('baz')
    cmp1 = ast.CompareOperator('>', l, v2)
    cmp2 = ast.CompareOperator('<', l, v)
    cmp3 = ast.CompareOperator('>', l, v)
    name = merge.node_name(cmp1, True)
    select = compare.select_rewrite_expression(name, [cmp1, cmp2, cmp3])
    assert (select is cmp2)

dataset/ETHPy150Open armon/pypred/tests/unit/test_compare.py TestCompare.test_select_rewrite_ord_literals/original