From 04926d0be884675f63a8c23d007392bd7f76e3f6 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 5 Apr 2017 13:41:09 -0700 Subject: [PATCH] minor test improvement --- src/wormhole/test/test_rlcompleter.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/wormhole/test/test_rlcompleter.py b/src/wormhole/test/test_rlcompleter.py index 238f18b..d35c773 100644 --- a/src/wormhole/test/test_rlcompleter.py +++ b/src/wormhole/test/test_rlcompleter.py @@ -231,6 +231,18 @@ class Completion(unittest.TestCase): c = CodeInputter(helper, reactor) cabc = c._commit_and_build_completions + # in this test, we pretend that nameplates 1 and 12 are active. + + # 43 TAB -> nothing (and refresh_nameplates) + gnc.configure_mock(return_value=[]) + matches = yield deferToThread(cabc, "43") + self.assertEqual(matches, []) + self.assertEqual(rn.mock_calls, [mock.call()]) + self.assertEqual(gnc.mock_calls, [mock.call("43")]) + self.assertEqual(cn.mock_calls, []) + rn.reset_mock() + gnc.reset_mock() + # 1 TAB -> 1, 12 (and refresh_nameplates) gnc.configure_mock(return_value=["", "2"]) matches = yield deferToThread(cabc, "1")