Search in sources :

Example 1 with PyStructureViewElement

use of com.jetbrains.python.structureView.PyStructureViewElement in project intellij-community by JetBrains.

the class PyStructureViewTest method testInvalidatedElement.

// EA-83566
public void testInvalidatedElement() {
    myFixture.configureByText("a.py", "def f():\n" + "    pass");
    final PyFunction function = myFixture.findElementByText("f", PyFunction.class);
    final PyStructureViewElement node = new PyStructureViewElement(function);
    WriteCommandAction.runWriteCommandAction(myFixture.getProject(), function::delete);
    assertNull(node.getValue());
    final ItemPresentation presentation = node.getPresentation();
    assertNotNull(presentation);
    final Icon icon = presentation.getIcon(false);
    assertNull(icon);
}
Also used : PyFunction(com.jetbrains.python.psi.PyFunction) PyStructureViewElement(com.jetbrains.python.structureView.PyStructureViewElement) ItemPresentation(com.intellij.navigation.ItemPresentation)

Aggregations

ItemPresentation (com.intellij.navigation.ItemPresentation)1 PyFunction (com.jetbrains.python.psi.PyFunction)1 PyStructureViewElement (com.jetbrains.python.structureView.PyStructureViewElement)1