MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_global_matches

Method test_global_matches

Lib/test/test_rlcompleter.py:34–49  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

32 self.assertRaises(TypeError, rlcompleter.Completer, B((1,)))
33
34 def test_global_matches(self):
35 # test with builtins namespace
36 self.assertEqual(sorted(self.stdcompleter.global_matches('di')),
37 [x+'(' for x in dir(builtins) if x.startswith('di')])
38 self.assertEqual(sorted(self.stdcompleter.global_matches('st')),
39 [x+'(' for x in dir(builtins) if x.startswith('st')])
40 self.assertEqual(self.stdcompleter.global_matches('akaksajadhak'), [])
41
42 # test with a customized namespace
43 self.assertEqual(self.completer.global_matches('CompleteM'),
44 ['CompleteMe(' if MISSING_C_DOCSTRINGS else 'CompleteMe()'])
45 self.assertEqual(self.completer.global_matches('eg'),
46 ['egg('])
47 # XXX: see issue5256
48 self.assertEqual(self.completer.global_matches('CompleteM'),
49 ['CompleteMe(' if MISSING_C_DOCSTRINGS else 'CompleteMe()'])
50
51 # TODO: RUSTPYTHON
52 @unittest.expectedFailure

Callers

nothing calls this directly

Calls 5

sortedFunction · 0.85
dirFunction · 0.85
global_matchesMethod · 0.80
assertEqualMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected