Add a small test case

This commit is contained in:
Stephan Kulow
2022-10-17 20:52:05 +02:00
parent 365696213b
commit c534fb028e
3 changed files with 40 additions and 2 deletions

View File

@@ -4,14 +4,15 @@ from lib.config import config
class DB:
def __init__(self):
def __init__(self, section="production"):
self.config_section = section
self.connect()
self.create_tables()
def connect(self):
try:
# read the connection parameters
params = config()
params = config(section=self.config_section)
# connect to the PostgreSQL server
self.conn = psycopg2.connect(**params)