Presentation (@NotNull VirtualFile directory) { MapDataContext mapDataContext = new MapDataContext(); mapDataContext.put(CommonDataKeys.VIRTUAL_FILE_ARRAY, new VirtualFile[] {directory}); mapDataContext.put(CommonDataKeys.PROJECT, myFixture.getProject()); mapDataContext.put(PlatformCoreDataKeys.MODULE, myFixture.getModule()); AnAction action = new PyMarkAsNamespacePackageAction(); AnActionEvent e = TestActionEvent.createTestEvent(action, mapDataContext); if (ActionUtil.lastUpdateAndCheckDumb(action, e, true)) { ActionUtil.performActionDumbAwareWithCallbacks(action, e); } return e.getPresentation(); }