def test_duplicate_table_aliases(self, completer, text):
     result = result_set(completer, text)
     self.assertSetEqual(result, set(testdata.schemas() + [
         table('orders o2'),
         table('users u'),
         table('"Users" U'),
         table('"select" s'),
         view('user_emails ue'),
         view('functions f'),
         function('_custom_fun() cf'),
         function('custom_fun() cf'),
         function('custom_func1() cf'),
         function('custom_func2() cf'),
         function(
             'set_returning_func(x := , y := ) srf',
             display='set_returning_func(x, y) srf'
         ),
     ]))
 def test_duplicate_aliases_with_casing(self, completer, text):
     result = result_set(completer, text)
     self.assertSetEqual(result, set([
         schema('PUBLIC'),
         table('Orders O2'),
         table('Users U'),
         table('"Users" U'),
         table('"select" s'),
         view('User_Emails UE'),
         view('Functions F'),
         function('_custom_fun() cf'),
         function('Custom_Fun() CF'),
         function('Custom_Func1() CF'),
         function('custom_func2() cf'),
         function(
             'set_returning_func(x := , y := ) srf',
             display='set_returning_func(x, y) srf'
         ),
     ]))
cased_users2_col_names = ['UserID', 'UserName']
cased_func_names = [
    'Custom_Fun', '_custom_fun', 'Custom_Func1', 'custom_func2', 'set_returning_func'
]
cased_tbls = ['Users', 'Orders']
cased_views = ['User_Emails', 'Functions']
casing = (
    ['SELECT', 'PUBLIC'] + cased_func_names + cased_tbls + cased_views
    + cased_users_col_names + cased_users2_col_names
)
# Lists for use in assertions
cased_funcs = [
    function(f) for f in ('Custom_Fun()', '_custom_fun()', 'Custom_Func1()', 'custom_func2()')
] + [function('set_returning_func(x := , y := )', display='set_returning_func(x, y)')]
cased_tbls = [table(t) for t in (cased_tbls + ['"Users"', '"select"'])]
cased_rels = [view(t) for t in cased_views] + cased_funcs + cased_tbls
cased_users_cols = [column(c) for c in cased_users_col_names]
aliased_rels = [
    table(t) for t in ('users u', '"Users" U', 'orders o', '"select" s')
] + [view('user_emails ue'), view('functions f')] + [
    function(f) for f in (
        '_custom_fun() cf', 'custom_fun() cf', 'custom_func1() cf',
        'custom_func2() cf'
    )
] + [function(
    'set_returning_func(x := , y := ) srf',
    display='set_returning_func(x, y) srf'
)]
cased_aliased_rels = [
    table(t) for t in ('Users U', '"Users" U', 'Orders O', '"select" s')
] + [view('User_Emails UE'), view('Functions F')] + [