void () { Map<String, PsiElement> marks = loadTest(); Assert.assertEquals(3, marks.size()); PsiElement elt = marks.get("<stmt>").getParent().getParent(); // keyword -> part -> stmt Assert.assertTrue(elt instanceof PyWhileStatement); PyWhileStatement while_stmt = (PyWhileStatement)elt; PyWhilePart while_part = while_stmt.getWhilePart(); PyExpression cond = while_part.getCondition(); Assert.assertEquals(marks.get("<cond>").getParent(), cond); elt = marks.get("<else>").getParent(); // keyword -> part Assert.assertTrue(elt instanceof PyElsePart); Assert.assertEquals(while_stmt.getElsePart(), elt); }