Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
with open_cursor(configuration) as cursor:
assert None == cursor.description
def fix_case(string):
if capabilities['reports_column_names_as_upper_case']:
return string.upper()
else:
return string
with query_fixture(cursor, configuration, 'DESCRIPTION') as table_name:
cursor.execute("SELECT * FROM {}".format(table_name))
nullness_for_null_column = not capabilities['indicates_null_columns']
expected = [(fix_case('as_int'), turbodbc.NUMBER, None, None, None, None, True),
(fix_case('as_double'), turbodbc.NUMBER, None, None, None, None, True),
(fix_case('as_varchar'), turbodbc.STRING, None, None, None, None, True),
(fix_case('as_date'), turbodbc.DATETIME, None, None, None, None, True),
(fix_case('as_timestamp'), turbodbc.DATETIME, None, None, None, None, True),
(fix_case('as_int_not_null'), turbodbc.NUMBER, None, None, None, None, nullness_for_null_column)]
assert expected == cursor.description