Loading test/test.py +12 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ from datetime import datetime from webbrowser import get from common.database import Database from common.mixins.postgres import PostgresMixin from common.mixins.mssql import MSSQLMixin from common.mixins.postgres_logger import PostgresLoggerMixin from common.logz import create_logger Loading @@ -17,6 +18,8 @@ from common.logz import create_logger class DBPG(Database, PostgresMixin): """Create the Database and PostgresMixin class.""" class DBMSAzure(Database, MSSQLMixin): """Create the Database and MSSQLMixin class.""" class PostgresTestCase(unittest.TestCase): """Test the Postgres connection case.""" Loading @@ -28,6 +31,15 @@ class PostgresTestCase(unittest.TestCase): with DBPG() as data_base: print(data_base.query("SELECT * FROM test_table")) class MSSQLTestCase(unittest.TestCase): """Test the Postgres connection case.""" def test_open(self): """ test_open: Test that the DB can successfully be opened """ with DBMSAzure() as db: print(db.query("SELECT * FROM test_table")) class DBConnTestCase(unittest.TestCase): def test_connection(self): Loading Loading
test/test.py +12 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ from datetime import datetime from webbrowser import get from common.database import Database from common.mixins.postgres import PostgresMixin from common.mixins.mssql import MSSQLMixin from common.mixins.postgres_logger import PostgresLoggerMixin from common.logz import create_logger Loading @@ -17,6 +18,8 @@ from common.logz import create_logger class DBPG(Database, PostgresMixin): """Create the Database and PostgresMixin class.""" class DBMSAzure(Database, MSSQLMixin): """Create the Database and MSSQLMixin class.""" class PostgresTestCase(unittest.TestCase): """Test the Postgres connection case.""" Loading @@ -28,6 +31,15 @@ class PostgresTestCase(unittest.TestCase): with DBPG() as data_base: print(data_base.query("SELECT * FROM test_table")) class MSSQLTestCase(unittest.TestCase): """Test the Postgres connection case.""" def test_open(self): """ test_open: Test that the DB can successfully be opened """ with DBMSAzure() as db: print(db.query("SELECT * FROM test_table")) class DBConnTestCase(unittest.TestCase): def test_connection(self): Loading