示例#1
0
 def test_builtin_function_name_completion(self, completer):
     result = result_set(completer, 'SELECT MA')
     self.assertSetEqual(
         result,
         set([
             function('MAX', -2),
             keyword('MAXEXTENTS', -2),
             keyword('MATERIALIZED VIEW', -2)
         ]))
    def test_columns_before_keywords(self, completer):
        text = 'SELECT * FROM orders WHERE s'
        completions = get_result(completer, text)

        col = column('status', -1)
        kw = keyword('SELECT', -1)

        self.assertTrue(completions.index(col) < completions.index(kw))
 def test_user_function_name_completion(self, completer):
     result = result_set(completer, 'SELECT cu')
     self.assertSetEqual(result, set([
         function('custom_fun()', -2),
         function('_custom_fun()', -2),
         function('custom_func1()', -2),
         function('custom_func2()', -2),
         keyword('CURRENT', -2),
     ]))
 def test_select_keyword_completion(self, completer):
     result = result_set(completer, 'SEL')
     self.assertSetEqual(result, set([keyword('SELECT', -3)]))