Added test for flattening union types

This commit is contained in:
Andrey Vlasovskikh
2015-04-01 16:09:26 +03:00
parent c832e56c07
commit 16add5f686
@@ -263,6 +263,14 @@ public class PyTypingTest extends PyTestCase {
" pass\n");
}
public void testFlattenUnions() {
doTest("Union[int, str, list]",
"from typing import Union\n" +
"\n" +
"def foo(expr: Union[int, Union[str, list]]):\n" +
" pass\n");
}
private void doTest(@NotNull String expectedType, @NotNull String text) {
myFixture.copyDirectoryToProject("typing", "");
myFixture.configureByText(PythonFileType.INSTANCE, text);