Example #1
0
 def test_suggestion_source_when_controller_and_row(self):
     suggestion_source = SuggestionSource(plugin=None, controller=self._controller_mock('foo'))
     suggestions = suggestion_source.get_suggestions('foo', 1)
     self.assertEqual(1, len(suggestions))
     self.assertEqual('foobar', suggestions[0].name)
Example #2
0
 def test_suggestion_source_when_no_controller(self):
     suggestion_source = SuggestionSource(plugin=self._plugin_mock('bar'),
                                          controller=None)
     suggestions = suggestion_source.get_suggestions('foo', 1)
     self.assertEqual(1, len(suggestions))
     self.assertEqual('barfoo', suggestions[0].name)
Example #3
0
 def test_suggestion_source_when_no_controller(self):
     suggestion_source = SuggestionSource(plugin=self._plugin_mock('bar'), controller=None)
     suggestions = suggestion_source.get_suggestions('foo', 1)
     self.assertEqual(1, len(suggestions))
     self.assertEqual('barfoo', suggestions[0].name)
Example #4
0
 def test_suggestion_source_when_controller_and_row(self):
     suggestion_source = SuggestionSource(
         plugin=None, controller=self._controller_mock('foo'))
     suggestions = suggestion_source.get_suggestions('foo', 1)
     self.assertEqual(1, len(suggestions))
     self.assertEqual('foobar', suggestions[0].name)