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_connection_to_db(self):
db_con = DbConnection()
# if connect() function call raises exception unit test fails
cursor = db_con.connect()
# is right instance and not null
self.assertIsInstance(cursor, pymssql.Cursor)