# Path: tests/compat.py
# PY3 = sys.version_info[0] >= 3
# PY33 = sys.version_info >= (3, 3)
# PY34 = sys.version_info >= (3, 4)
# PY35 = sys.version_info >= (3, 5)
# PY36 = sys.version_info >= (3, 6)
# PY27 = sys.version_info >= (2, 7)


import re
import unittest
import pkg_resources
import ctds
from .compat import PY27, StandardError_
    def test_threadsafety(self):
        self.assertEqual(ctds.threadsafety, 1)

    def test_paramstyle(self):
        self.assertEqual(ctds.paramstyle, 'numeric')

    def test_freetds_version(self):
        version = ctds.freetds_version
        self.assertTrue(isinstance(version, str))
        self.assertTrue(
            re.match(
                r'^freetds v(?P<major>[\d]+)\.(?P<minor>[\d]+)(?:\.(?P<patch>[\d]+))?$',
                version
            )
        )

    def test_exceptions(self):
        self.assertTrue(issubclass(ctds.Warning, StandardError_))
        self.assertEqual(
            ctds.Warning.__doc__,
            '''\
Warning

:pep:`0249#warning`

Exception raised for important warnings like data truncations while
inserting, etc.
''' if PY27 else None
        )


# Path: tests/compat.py
# PY3 = sys.version_info[0] >= 3
# PY33 = sys.version_info >= (3, 3)
# PY34 = sys.version_info >= (3, 4)
# PY35 = sys.version_info >= (3, 5)
# PY36 = sys.version_info >= (3, 6)
# PY27 = sys.version_info >= (2, 7)


# Path: tests/test_tds.py
import re
import unittest
import pkg_resources
import ctds
from .compat import PY27, StandardError_

    def test_threadsafety(self):
        self.assertEqual(ctds.threadsafety, 1)

    def test_paramstyle(self):
        self.assertEqual(ctds.paramstyle, 'numeric')

    def test_freetds_version(self):
        version = ctds.freetds_version
        self.assertTrue(isinstance(version, str))
        self.assertTrue(
            re.match(
                r'^freetds v(?P<major>[\d]+)\.(?P<minor>[\d]+)(?:\.(?P<patch>[\d]+))?$',
                version
            )
        )

    def test_exceptions(self):
        self.assertTrue(issubclass(ctds.Warning, StandardError_))
        self.assertEqual(
            ctds.Warning.__doc__,
            '''\
Warning

:pep:`0249#warning`

Exception raised for important warnings like data truncations while
inserting, etc.
''' if PY27 else None
        )


        self.assertTrue(issubclass(ctds.Error, StandardError_))