fast_parent_copy should also change the parent of NameParts.

This commit is contained in:
Dave Halter
2014-08-14 23:47:22 +02:00
parent 1f9e7ddff8
commit 1965469050
2 changed files with 29 additions and 11 deletions

View File

@@ -0,0 +1,10 @@
from jedi.evaluate.helpers import fast_parent_copy
from jedi.parser import representation as pr
def test_fast_parent_copy():
name = pr.Name(object, [('hallo', (0, 0))], (0, 0), (0, 0))
# fast parent copy should switch parent
new_name = fast_parent_copy(name)
assert new_name.names[0].parent == new_name