docker-postgis/scenario_tests/init_scripts/tests/test_entrypoint.py

23 wiersze
485 B
Python

import unittest
from utils.utils import DBConnection
class TestInitScript(unittest.TestCase):
def setUp(self):
self.db = DBConnection()
def test_read_data(self):
# create new table
self.db.conn.autocommit = True
with self.db.cursor() as c:
c.execute(
"""
SELECT * FROM test_init_table;
"""
)
rows = c.fetchall()
self.assertEqual(len(rows), 1)