Commit d10ed92a authored by Huihui, Jonathan's avatar Huihui, Jonathan
Browse files

add unit test for ms sql mixin

parent 7657d97a
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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

@@ -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."""
@@ -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):