stress_at_work_analysis/test/database.py

19 lines
416 B
Python

import unittest
from sqlalchemy import create_engine
from setup import db_uri
class DatabaseConnection(unittest.TestCase):
def setUp(self):
self.engine = create_engine(db_uri, echo=True)
def tearDown(self):
self.engine.dispose()
def test_connection(self):
with self.engine.connect() as connection:
self.assertIsNotNone(connection)
connection.close()