void () { String baseName = "refactoring/extractsuperclass/multifile/"; myFixture.configureByFile(baseName + "source.py"); final String className = "Foo"; final String superclassName = "Suppa"; final PyClass clazz = findClass(className); final List<PyMemberInfo<PyElement>> members = new ArrayList<>(); final PyElement member = findMember(className, ".foo"); members.add(MembersManager.findMember(clazz, member)); final VirtualFile base_dir = myFixture.getFile().getVirtualFile().getParent(); WriteCommandAction.writeCommandAction(myFixture.getProject()).run(() -> { final String path = base_dir.getPath() + "/a/b"; PyExtractSuperclassHelper.extractSuperclass(clazz, members, superclassName, path); }); final PsiManager psi_mgr = PsiManager.getInstance(myFixture.getProject()); VirtualFile vfile = base_dir.findChild("a"); assertTrue(vfile.isDirectory()); vfile = vfile.findChild(PyNames.INIT_DOT_PY); assertNotNull(vfile); vfile = base_dir.findChild("a").findChild("b"); assertTrue(vfile.isDirectory()); vfile = vfile.findChild(PyNames.INIT_DOT_PY); assertNotNull(vfile); PsiFile psi_file = psi_mgr.findFile(vfile); String result = psi_file.getText().trim(); File expected_file = new File(getTestDataPath(), baseName + "target.new.py"); String expected = psi_mgr.findFile(LocalFileSystem.getInstance().findFileByIoFile(expected_file)).getText().trim(); assertEquals(expected, result); }