mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
Test resolution collision (submodule vs __init__.py)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# here we export boo() and not module boo
|
||||
from boo import boo
|
||||
|
||||
b = boo()
|
||||
# <ref>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# the typical way to provide a default implementation;
|
||||
# see curses.has_key()
|
||||
class boo(object):
|
||||
pass
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# we import a value
|
||||
from boo import BOO
|
||||
print(BOO)
|
||||
# <ref>
|
||||
@@ -0,0 +1 @@
|
||||
BOO = "only kidding"
|
||||
@@ -131,6 +131,19 @@ public class PyMultiFileResolveTest extends PyResolveTestCase {
|
||||
assertEquals("silicate", ((PyStringLiteralExpression)value).getStringValue());
|
||||
}
|
||||
|
||||
public void testModuleValueCollision() throws Exception {
|
||||
PsiElement element = doResolve();
|
||||
assertTrue(element instanceof PyTargetExpression);
|
||||
PsiElement value = ((PyTargetExpression)element).findAssignedValue();
|
||||
assertEquals("only kidding", ((PyStringLiteralExpression)value).getStringValue());
|
||||
}
|
||||
|
||||
public void testModuleClassCollision() throws Exception {
|
||||
PsiElement element = doResolve();
|
||||
assertTrue(element instanceof PyClass);
|
||||
assertEquals("boo", ((PyClass)element).getName());
|
||||
}
|
||||
|
||||
public void testDirectoryVsClass() throws Exception {
|
||||
assertResolvesTo(PyClass.class, "Context");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user