File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,6 +60,38 @@ def test_imports_symbol_from_module_ignores_unrelated_symbols():
6060 )
6161
6262
63+ def test_imports_symbol_from_module_supports_aliased_symbol_import ():
64+ module_text = (
65+ "from tests.ast_import_utils import imports_collect_function_sources as helper\n "
66+ "helper('dummy')\n "
67+ )
68+
69+ assert (
70+ imports_symbol_from_module (
71+ module_text ,
72+ module = "tests.ast_import_utils" ,
73+ symbol = "imports_collect_function_sources" ,
74+ )
75+ is True
76+ )
77+
78+
79+ def test_imports_symbol_from_module_ignores_non_from_import ():
80+ module_text = (
81+ "import tests.ast_import_utils as import_utils\n "
82+ "import_utils.imports_collect_function_sources('dummy')\n "
83+ )
84+
85+ assert (
86+ imports_symbol_from_module (
87+ module_text ,
88+ module = "tests.ast_import_utils" ,
89+ symbol = "imports_collect_function_sources" ,
90+ )
91+ is False
92+ )
93+
94+
6395def test_imports_collect_function_sources_supports_aliased_import ():
6496 module_text = (
6597 "from tests.ast_function_source_utils import collect_function_sources as cfs\n "
You can’t perform that action at this time.
0 commit comments