# Path: tests/helpers.py
# def eq_(a, b):
# def skip_test(reason='No reason given to skip_test'):
# def mark_slow(f):
#     def __str__(self):
# def mssqlconn(conn_properties=None):
# def pymssqlconn(**kwargs):
# def get_app_lock():
# def release_app_lock():
# def drop_table(conn, tname):
# def clear_table(conn, tname):
#     def table_sql(cls):
#     def newconn(cls):
#     def setup_class(cls):
#     def setUp(self):
#     def row_count(self):
#     def execute(self, sql, params=None):
#     def __init__(self, conn, tname, *cols):
#     def table_sql(self):
#     def drop(self):
#     def execute(self, sql):
#     def create(self):
#     def clear(self):
#     def count(self):
#     def execute(self, sql):
#     def executemany(self, sql, params_seq):
#     def setup_class(cls):
#     def setup_method(self, method):
#     def test_description_not_used(self):
#     def test_description_after_insert(self):
#     def test_description_after_select(self):
#     def test_sticky_description(self):
#     def test_fetchone(self):
#     def test_insert_rowcount(self):
#     def test_delete_rowcount(self):
#     def test_update_rowcount(self):
#     def test_select_rowcount(self):
#     def test_fetchone_rowcount(self):
#     def test_fetchmany_rowcount(self):
#     def test_as_dict(self):
#     def test_as_dict_no_column_name(self):
#     def test_as_dict_no_column_name_2(self):
#     def test_fetchmany(self):
#     def test_execute_many(self):
# def clear_db():
#     def __init__(self, name, args, body, mssql=None):
#     def create(self, mssql=None):
#     def execute(self, mssql=None, args=()):
#     def drop(self, mssql=None):
#     def __enter__(self):
#     def __exit__(self, type, value, tb):
# def get_sql_server_version(mssql_connection):
# class Config(object):
# class PyTableBase(object):
# class TableManager(object):
# class DBAPIBase(object):
# class CursorBase(DBAPIBase):
# class StoredProc(object):
# 
# Path: tests/helpers.py
# def eq_(a, b):
# def skip_test(reason='No reason given to skip_test'):
# def mark_slow(f):
#     def __str__(self):
# def mssqlconn(conn_properties=None):
# def pymssqlconn(**kwargs):
# def get_app_lock():
# def release_app_lock():
# def drop_table(conn, tname):
# def clear_table(conn, tname):
#     def table_sql(cls):
#     def newconn(cls):
#     def setup_class(cls):
#     def setUp(self):
#     def row_count(self):
#     def execute(self, sql, params=None):
#     def __init__(self, conn, tname, *cols):
#     def table_sql(self):
#     def drop(self):
#     def execute(self, sql):
#     def create(self):
#     def clear(self):
#     def count(self):
#     def execute(self, sql):
#     def executemany(self, sql, params_seq):
#     def setup_class(cls):
#     def setup_method(self, method):
#     def test_description_not_used(self):
#     def test_description_after_insert(self):
#     def test_description_after_select(self):
#     def test_sticky_description(self):
#     def test_fetchone(self):
#     def test_insert_rowcount(self):
#     def test_delete_rowcount(self):
#     def test_update_rowcount(self):
#     def test_select_rowcount(self):
#     def test_fetchone_rowcount(self):
#     def test_fetchmany_rowcount(self):
#     def test_as_dict(self):
#     def test_as_dict_no_column_name(self):
#     def test_as_dict_no_column_name_2(self):
#     def test_fetchmany(self):
#     def test_execute_many(self):
# def clear_db():
#     def __init__(self, name, args, body, mssql=None):
#     def create(self, mssql=None):
#     def execute(self, mssql=None, args=()):
#     def drop(self, mssql=None):
#     def __enter__(self):
#     def __exit__(self, type, value, tb):
# def get_sql_server_version(mssql_connection):
# class Config(object):
# class PyTableBase(object):
# class TableManager(object):
# class DBAPIBase(object):
# class CursorBase(DBAPIBase):
# class StoredProc(object):


import binascii
import decimal
import pickle
import sys
import unittest
import uuid
import pymssql
import pytest
from datetime import time
from datetime import date
from datetime import datetime
from decimal import Decimal as D
from hashlib import md5
from .helpers import get_sql_server_version, mssql_server_required
    from io import BytesIO
from .helpers import drop_table, mssqlconn, clear_table, config, eq_, pymssqlconn

    def test_uuid_passed_as_string(self):
        """
        Test the case when the application passes a string representation of
        the uuid.UUID data type to _mssql.
        """
        origval = uuid.uuid4()
        stestval = str(origval)
        colval = self.insert_and_select('uuid', stestval, 's')
        typeeq(origval, colval)
        eq_(origval, colval)

    def test_uuid_passed_as_python_datatype(self):
        """
        Test the case when the application passes an instance of the uuid.UUID
        data type to _mssql to confirm it can handle it.
        """
        origval = uuid.uuid4()
        colval = self.insert_and_select('uuid', origval, 's')
        typeeq(origval, colval)
        eq_(origval, colval)


@mssql_server_required
class TestTypesPymssql(unittest.TestCase):
    tname = 'pymssql'

    @classmethod
    def setup_class(cls):
        cls.conn = pymssqlconn()

# Path: tests/helpers.py
# def eq_(a, b):
# def skip_test(reason='No reason given to skip_test'):
# def mark_slow(f):
#     def __str__(self):
# def mssqlconn(conn_properties=None):
# def pymssqlconn(**kwargs):
# def get_app_lock():
# def release_app_lock():
# def drop_table(conn, tname):
# def clear_table(conn, tname):
#     def table_sql(cls):
#     def newconn(cls):
#     def setup_class(cls):
#     def setUp(self):
#     def row_count(self):
#     def execute(self, sql, params=None):
#     def __init__(self, conn, tname, *cols):
#     def table_sql(self):
#     def drop(self):
#     def execute(self, sql):
#     def create(self):
#     def clear(self):
#     def count(self):
#     def execute(self, sql):
#     def executemany(self, sql, params_seq):
#     def setup_class(cls):
#     def setup_method(self, method):
#     def test_description_not_used(self):
#     def test_description_after_insert(self):
#     def test_description_after_select(self):
#     def test_sticky_description(self):
#     def test_fetchone(self):
#     def test_insert_rowcount(self):
#     def test_delete_rowcount(self):
#     def test_update_rowcount(self):
#     def test_select_rowcount(self):
#     def test_fetchone_rowcount(self):
#     def test_fetchmany_rowcount(self):
#     def test_as_dict(self):
#     def test_as_dict_no_column_name(self):
#     def test_as_dict_no_column_name_2(self):
#     def test_fetchmany(self):
#     def test_execute_many(self):
# def clear_db():
#     def __init__(self, name, args, body, mssql=None):
#     def create(self, mssql=None):
#     def execute(self, mssql=None, args=()):
#     def drop(self, mssql=None):
#     def __enter__(self):
#     def __exit__(self, type, value, tb):
# def get_sql_server_version(mssql_connection):
# class Config(object):
# class PyTableBase(object):
# class TableManager(object):
# class DBAPIBase(object):
# class CursorBase(DBAPIBase):
# class StoredProc(object):
# 
# Path: tests/helpers.py
# def eq_(a, b):
# def skip_test(reason='No reason given to skip_test'):
# def mark_slow(f):
#     def __str__(self):
# def mssqlconn(conn_properties=None):
# def pymssqlconn(**kwargs):
# def get_app_lock():
# def release_app_lock():
# def drop_table(conn, tname):
# def clear_table(conn, tname):
#     def table_sql(cls):
#     def newconn(cls):
#     def setup_class(cls):
#     def setUp(self):
#     def row_count(self):
#     def execute(self, sql, params=None):
#     def __init__(self, conn, tname, *cols):
#     def table_sql(self):
#     def drop(self):
#     def execute(self, sql):
#     def create(self):
#     def clear(self):
#     def count(self):
#     def execute(self, sql):
#     def executemany(self, sql, params_seq):
#     def setup_class(cls):
#     def setup_method(self, method):
#     def test_description_not_used(self):
#     def test_description_after_insert(self):
#     def test_description_after_select(self):
#     def test_sticky_description(self):
#     def test_fetchone(self):
#     def test_insert_rowcount(self):
#     def test_delete_rowcount(self):
#     def test_update_rowcount(self):
#     def test_select_rowcount(self):
#     def test_fetchone_rowcount(self):
#     def test_fetchmany_rowcount(self):
#     def test_as_dict(self):
#     def test_as_dict_no_column_name(self):
#     def test_as_dict_no_column_name_2(self):
#     def test_fetchmany(self):
#     def test_execute_many(self):
# def clear_db():
#     def __init__(self, name, args, body, mssql=None):
#     def create(self, mssql=None):
#     def execute(self, mssql=None, args=()):
#     def drop(self, mssql=None):
#     def __enter__(self):
#     def __exit__(self, type, value, tb):
# def get_sql_server_version(mssql_connection):
# class Config(object):
# class PyTableBase(object):
# class TableManager(object):
# class DBAPIBase(object):
# class CursorBase(DBAPIBase):
# class StoredProc(object):


# Path: tests/test_types.py
import binascii
import decimal
import pickle
import sys
import unittest
import uuid
import pymssql
import pytest
from datetime import time
from datetime import date
from datetime import datetime
from decimal import Decimal as D
from hashlib import md5
from .helpers import get_sql_server_version, mssql_server_required
    from io import BytesIO
from .helpers import drop_table, mssqlconn, clear_table, config, eq_, pymssqlconn


    def test_uuid_passed_as_string(self):
        """
        Test the case when the application passes a string representation of
        the uuid.UUID data type to _mssql.
        """
        origval = uuid.uuid4()
        stestval = str(origval)
        colval = self.insert_and_select('uuid', stestval, 's')
        typeeq(origval, colval)
        eq_(origval, colval)

    def test_uuid_passed_as_python_datatype(self):
        """
        Test the case when the application passes an instance of the uuid.UUID
        data type to _mssql to confirm it can handle it.
        """
        origval = uuid.uuid4()
        colval = self.insert_and_select('uuid', origval, 's')
        typeeq(origval, colval)
        eq_(origval, colval)


@mssql_server_required
class TestTypesPymssql(unittest.TestCase):
    tname = 'pymssql'

    @classmethod
    def setup_class(cls):
        cls.conn = pymssqlconn()

        drop_table(cls.conn._conn, cls.tname)