()
| 1025 | |
| 1026 | |
| 1027 | def test_set_custom_completer(): |
| 1028 | num_completers = len(ip.Completer.matchers) |
| 1029 | |
| 1030 | def foo(*args, **kwargs): |
| 1031 | return "I'm a completer!" |
| 1032 | |
| 1033 | ip.set_custom_completer(foo, 0) |
| 1034 | |
| 1035 | # check that we've really added a new completer |
| 1036 | assert len(ip.Completer.matchers) == num_completers + 1 |
| 1037 | |
| 1038 | # check that the first completer is the function we defined |
| 1039 | assert ip.Completer.matchers[0]() == "I'm a completer!" |
| 1040 | |
| 1041 | # clean up |
| 1042 | ip.Completer.custom_matchers.pop() |
nothing calls this directly
no test coverage detected