stress_at_work_analysis/test/test_database.py

19 lines
416 B
Python
Raw Normal View History

2020-12-24 14:08:31 +01:00
import unittest
2020-12-24 14:29:47 +01:00
2020-12-24 16:06:23 +01:00
from sqlalchemy import create_engine
2020-12-24 14:11:58 +01:00
2020-12-24 16:06:23 +01:00
from setup import db_uri
2020-12-24 14:08:31 +01:00
class DatabaseConnection(unittest.TestCase):
def setUp(self):
2020-12-24 16:06:23 +01:00
self.engine = create_engine(db_uri, echo=True)
2020-12-24 14:08:31 +01:00
def tearDown(self):
2020-12-24 16:06:23 +01:00
self.engine.dispose()
2020-12-24 14:08:31 +01:00
def test_connection(self):
2020-12-24 16:06:23 +01:00
with self.engine.connect() as connection:
self.assertIsNotNone(connection)
connection.close()