forked from importers/git-importer
Add a small test case
This commit is contained in:
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user