Reformat code.
parent
c735ff7a85
commit
e8b5f93401
|
@ -0,0 +1,21 @@
|
||||||
|
import unittest
|
||||||
|
import psycopg2
|
||||||
|
import os
|
||||||
|
|
||||||
|
db_host = "212.235.208.113"
|
||||||
|
db_database = "staw"
|
||||||
|
db_user = "staw_db"
|
||||||
|
|
||||||
|
class DatabaseConnection(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.conn = psycopg2.connect(host=db_host,
|
||||||
|
user=db_user,
|
||||||
|
password=os.getenv("DB_PASSWORD"),
|
||||||
|
database=db_database)
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
self.conn.close()
|
||||||
|
|
||||||
|
def test_connection(self):
|
||||||
|
with self.conn.cursor() as cursor:
|
||||||
|
self.assertIsNotNone(cursor)
|
Loading…
Reference in New Issue