Loading test/test.py +2 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ from common.logz import create_logger class DBPG(Database, PostgresMixin): """Create the Database and PostgresMixin class.""" class DBMSAzure(Database, MSSQLMixin): class DBMSAzure(MSSQLMixin, Database): """Create the Database and MSSQLMixin class.""" class PostgresTestCase(unittest.TestCase): Loading @@ -39,7 +39,7 @@ class MSSQLTestCase(unittest.TestCase): Test that the DB can successfully be opened """ with DBMSAzure() as db: print(db.query("SELECT * FROM test_table")) res = db.query("SELECT * FROM CommonDB.dbo.TestDBTable") class DBConnTestCase(unittest.TestCase): def test_connection(self): Loading test/test_mssql.py +10 −3 Original line number Diff line number Diff line Loading @@ -8,8 +8,10 @@ from common.database import Database from common.mixins.mssql import MSSQLMixin from common.logz import create_logger logger = create_logger() class DBMSAzure(Database, MSSQLMixin): class DBMSAzure(MSSQLMixin, Database): """ Create the Database with MSSQLMixin class. """ def __init__(self, **kwargs): super().__init__() Loading @@ -20,5 +22,10 @@ class DBMSAzure(Database, MSSQLMixin): else: return {"msg":"fail"} if __name__ == "__main__": with DBMSAzure() as db: db.access() logger.info(db.access()) logger.info(f"This is a logging statment.") Loading
test/test.py +2 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ from common.logz import create_logger class DBPG(Database, PostgresMixin): """Create the Database and PostgresMixin class.""" class DBMSAzure(Database, MSSQLMixin): class DBMSAzure(MSSQLMixin, Database): """Create the Database and MSSQLMixin class.""" class PostgresTestCase(unittest.TestCase): Loading @@ -39,7 +39,7 @@ class MSSQLTestCase(unittest.TestCase): Test that the DB can successfully be opened """ with DBMSAzure() as db: print(db.query("SELECT * FROM test_table")) res = db.query("SELECT * FROM CommonDB.dbo.TestDBTable") class DBConnTestCase(unittest.TestCase): def test_connection(self): Loading
test/test_mssql.py +10 −3 Original line number Diff line number Diff line Loading @@ -8,8 +8,10 @@ from common.database import Database from common.mixins.mssql import MSSQLMixin from common.logz import create_logger logger = create_logger() class DBMSAzure(Database, MSSQLMixin): class DBMSAzure(MSSQLMixin, Database): """ Create the Database with MSSQLMixin class. """ def __init__(self, **kwargs): super().__init__() Loading @@ -20,5 +22,10 @@ class DBMSAzure(Database, MSSQLMixin): else: return {"msg":"fail"} if __name__ == "__main__": with DBMSAzure() as db: db.access() logger.info(db.access()) logger.info(f"This is a logging statment.")