MCPcopy Index your code
hub / github.com/bpython/bpython / test_issue_847

Method test_issue_847

bpython/test/test_importcompletion.py:196–219  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

194
195class TestBugReports(unittest.TestCase):
196 def test_issue_847(self):
197 with tempfile.TemporaryDirectory() as import_test_folder:
198 # ./xyzzy
199 # ./xyzzy/__init__.py
200 # ./xyzzy/plugh
201 # ./xyzzy/plugh/__init__.py
202 # ./xyzzy/plugh/bar.py
203 # ./xyzzy/plugh/foo.py
204
205 base_path = Path(import_test_folder)
206 (base_path / "xyzzy" / "plugh").mkdir(parents=True)
207 (base_path / "xyzzy" / "__init__.py").touch()
208 (base_path / "xyzzy" / "plugh" / "__init__.py").touch()
209 (base_path / "xyzzy" / "plugh" / "bar.py").touch()
210 (base_path / "xyzzy" / "plugh" / "foo.py").touch()
211
212 module_gatherer = ModuleGatherer((base_path.absolute(),))
213 while module_gatherer.find_coroutine():
214 pass
215
216 self.assertSetEqual(
217 module_gatherer.complete(17, "from xyzzy.plugh."),
218 {"xyzzy.plugh.bar", "xyzzy.plugh.foo"},
219 )
220
221
222if __name__ == "__main__":

Callers

nothing calls this directly

Calls 3

find_coroutineMethod · 0.95
completeMethod · 0.95
ModuleGathererClass · 0.90

Tested by

no test coverage detected