def test_goto_assignments():
    """Check goto assignments works."""

    assignments = anaconda_mode.goto_assignments('''
a = True
if a:
    x = 1
x
''', 5, 1, None)

    assert 4 == assignments[0]['line']
Example #2
0
def test_goto_assignments():
    """Check goto assignments works."""

    assignments = anaconda_mode.goto_assignments('''
if a:      x = 1
else if b: x = 2
else if c: x = 3
else:      x = 4
    x
''', 6, 5, None)

    assert sorted(assign['line'] for assign in assignments) == [2, 3, 4, 5]