PY-21292 Properly delete obsolete imports of moved symbols

Some of them might have been left if the corresponding symbols were used
and imported via "from" imports in the same module or new imports of them
were combined with some exiting "from" imports in a dependent module.
This commit is contained in:
Mikhail Golubev
2016-11-22 17:50:21 +03:00
parent d51fa3ee60
commit 5c3b5e06fa
13 changed files with 50 additions and 1 deletions
@@ -361,6 +361,16 @@ public class PyMoveTest extends PyTestCase {
doMoveSymbolTest("func", "b.py");
}
// PY-21292
public void testStaleFromImportsRemovedWhenSeveralMovedSymbolsUsedInSameModule() {
doMoveSymbolsTest("b.py", "A", "B");
}
// PY-21292
public void testStaleFromImportRemovedWhenNewImportCombinedWithExistingImport() {
doMoveSymbolTest("A", "b.py");
}
private void doMoveFileTest(String fileName, String toDirName) {
Project project = myFixture.getProject();
PsiManager manager = PsiManager.getInstance(project);