Reformat code.

communication
junos 2020-12-24 14:08:31 +01:00
parent c735ff7a85
commit e8b5f93401
1 changed files with 21 additions and 0 deletions

21
test/database.py 100644
View File

@ -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)