Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_drivers(self):
p = pyodbc.drivers()
self.assertTrue(isinstance(p, list))
def test_drivers(self):
drivers = pyodbc.drivers()
self.assertEqual(list, type(drivers))
self.assertTrue(len(drivers) > 0)
m = re.search('DRIVER={?([^}]+?)}?;', self.connection_string, re.IGNORECASE)
current = m.group(1)
self.assertTrue(current in drivers)
def test_drivers(self):
p = pyodbc.drivers()
self.assertTrue(isinstance(p, list))
def test_drivers(self):
p = pyodbc.drivers()
self.assertTrue(isinstance(p, list))
def test_drivers(self):
p = pyodbc.drivers()
self.assertTrue(isinstance(p, list))
def test_drivers(self):
p = pyodbc.drivers()
self.assertTrue(isinstance(p, list))
def test_drivers(self):
drivers = pyodbc.drivers()
self.assertEqual(list, type(drivers))
self.assertTrue(len(drivers) > 1)
m = re.search('DRIVER={?([^}]+?)}?;', self.connection_string, re.IGNORECASE)
current = m.group(1)
self.assertTrue(current in drivers)
def sql_server_odbc_driver_is_loaded(odbc_driver):
"""
Check if pyodbc can see the specified ODBC driver.
:return: boolean
"""
return odbc_driver in pyodbc.drivers()
def check_access_driver():
return [x for x in pyodbc.drivers() if x.startswith("Microsoft Access Driver")]
def check_pyodbc_drivers(self, driver_database):
if not next(iter(list(filter(lambda x: x == driver_database, pyodbc.drivers()))), None):
error_message = f"Driver: '{driver_database}' isn't a valid driver name!"
self.webapp_internal.restart_counter = 3
self.webapp_internal.log_error(error_message)