def test_keyword_upper_casing(self):
        new_completer = PGCompleter(smart_completion=True,
                                    settings={'keyword_casing': 'upper'})
        text = 'sel'
        position = len(text)
        result = new_completer.get_completions(
            Document(text=text, cursor_position=position), self.complete_event)

        # then completions should now be lower case
        self.assertEqual(result, [
            Completion(
                text='SELECT', start_position=-3, display_meta="keyword")
        ])
    def test_keyword_auto_casing(self):
        new_completer = PGCompleter(smart_completion=True,
                                    settings={'keyword_casing': 'auto'})

        # if text is lower case
        text = 'sel'
        position = len(text)
        result = new_completer.get_completions(
            Document(text=text, cursor_position=position), self.complete_event)

        # then completions should be lower case as well
        self.assertEqual(result, [
            Completion(
                text='select', start_position=-3, display_meta="keyword")
        ])
Esempio n. 3
0
 def setUp(self):
     self.completer = PGCompleter()
Esempio n. 4
0
 def setUp(self):
     self.completer = PGCompleter(smart_completion=False)
     self.complete_event = Mock()