void () { 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); }