@@ -15,19 +15,45 @@ def setUp(self):
1515 "zzefg" ,
1616 "zzabc.e" ,
1717 "zzabc.f" ,
18+ "zzefg.a1" ,
19+ "zzefg.a2"
1820 ]
1921
2022 def test_simple_completion (self ):
2123 self .assertSetEqual (
2224 self .module_gatherer .complete (10 , "import zza" ), {"zzabc" , "zzabd" }
2325 )
2426
25- def test_package_completion (self ):
27+ def test_import_empty (self ):
2628 self .assertSetEqual (
2729 self .module_gatherer .complete (13 , "import zzabc." ),
2830 {"zzabc.e" , "zzabc.f" },
2931 )
3032
33+ def test_import (self ):
34+ self .assertSetEqual (
35+ self .module_gatherer .complete (14 , "import zzefg.a" ),
36+ {"zzefg.a1" , "zzefg.a2" },
37+ )
38+
39+
40+ @unittest .expectedFailure
41+ def test_import_empty (self ):
42+ self .assertSetEqual (
43+ self .module_gatherer .complete (7 , "import " ), {"zzabc" , "zzabd" , "zzefg" }
44+ )
45+
46+ @unittest .expectedFailure
47+ def test_from_import_empty (self ):
48+ self .assertSetEqual (
49+ self .module_gatherer .complete (18 , "from zzabc import " ), {"e" , "f" }
50+ )
51+
52+ def test_from_import (self ):
53+ self .assertSetEqual (
54+ self .module_gatherer .complete (19 , "from zzefg import a" ), {"a1" , "a2" }
55+ )
56+
3157
3258class TestRealComplete (unittest .TestCase ):
3359 def setUp (self ):
@@ -52,6 +78,11 @@ def test_from_package(self):
5278 self .module_gatherer .complete (17 , "from xml import d" ), {"dom" }
5379 )
5480
81+ def test_from_package (self ):
82+ self .assertSetEqual (
83+ self .module_gatherer .complete (17 , "from xml import d" ), {"dom" }
84+ )
85+
5586
5687class TestAvoidSymbolicLinks (unittest .TestCase ):
5788 def setUp (self ):
0 commit comments