Beispiel #1
0
def test_multilline_no_transform():
    # no subprocess transformations happen here since all variables are known
    code = 'ls = 1\nl = 1\nls -l\n'
    tree = check_parse(code)
    lsnode = tree.body[2]
    assert 3 == min_line(lsnode)
    assert isinstance(lsnode.value, BinOp)
Beispiel #2
0
def test_multilline_no_transform():
    # No subprocess transformations happen here, since all variables are known.
    code = "ls = 1\nl = 1\nls -l\n"
    tree = check_parse(code)
    lsnode = tree.body[2]
    assert 3 == min_line(lsnode)
    assert isinstance(lsnode.value, BinOp)
Beispiel #3
0
def test_multilline_num(xonsh_execer, line1):
    # Subprocess transformation happens on the second line,
    # because not all variables are known.
    code = line1 + "\nls -l\n"
    tree = check_parse(code)
    lsnode = tree.body[1]
    assert 2 == min_line(lsnode)
    assert isinstance(lsnode.value, Call)
Beispiel #4
0
def test_multilline_num():
    code = ('x = 1\n'
            'ls -l\n')  # this second line wil be transformed
    tree = check_parse(code)
    lsnode = tree.body[1]
    assert 2 == min_line(lsnode)
Beispiel #5
0
def test_multilline_num(xonsh_builtins, line1):
    code = line1 + '\nls -l\n'
    tree = check_parse(code)
    lsnode = tree.body[1]
    assert 2 == min_line(lsnode)
    assert isinstance(lsnode.value, Call)
Beispiel #6
0
def test_multilline_num():
    code = ('x = 1\n' 'ls -l\n')  # this second line wil be transformed
    tree = check_parse(code)
    lsnode = tree.body[1]
    assert_equal(2, min_line(lsnode))
Beispiel #7
0
def test_multilline_num(line1):
    code = line1 + '\nls -l\n'
    tree = check_parse(code)
    lsnode = tree.body[1]
    assert 2 == min_line(lsnode)
    assert isinstance(lsnode.value, Call)
Beispiel #8
0
def test_multilline_num(xonsh_execer, line1):
    code = line1 + "\nls -l\n"
    tree = check_parse(code)
    lsnode = tree.body[1]
    assert 2 == min_line(lsnode)
    assert isinstance(lsnode.value, Call)
Beispiel #9
0
def test_multilline_num(line1):
    code = line1 + "\nls -l\n"
    tree = check_parse(code)
    lsnode = tree.body[1]
    assert 2 == min_line(lsnode)
    assert isinstance(lsnode.value, Call)