void () { myFixture.configureByFile(getTestName(true) + ".py"); final PsiFile file = myFixture.getFile(); moveByText("func"); assertFalse(isActionEnabled()); moveByText("local"); assertTrue(isActionEnabled()); // move to "def" keyword myFixture.getEditor().getCaretModel().moveCaretRelatively(-3, 0, false, false, false); final PsiElement tokenAtCaret = file.findElementAt(myFixture.getCaretOffset()); assertNotNull(tokenAtCaret); assertEquals(PyTokenTypes.DEF_KEYWORD, tokenAtCaret.getNode().getElementType()); assertTrue(isActionEnabled()); moveByText("method"); assertTrue(isActionEnabled()); moveByText("static_method"); assertFalse(isActionEnabled()); moveByText("class_method"); assertFalse(isActionEnabled()); // Overridden method moveByText("overridden_method"); assertFalse(isActionEnabled()); // Overriding method moveByText("upper"); assertFalse(isActionEnabled()); moveByText("property"); assertFalse(isActionEnabled()); moveByText("__magic__"); assertFalse(isActionEnabled()); }