# Path: os_win/_hacking/checks.py
# UNDERSCORE_IMPORT_FILES = []
#     CHECK_DESC = ('N325 str() and unicode() cannot be used on an '
#                   'exception.  Remove or use six.text_type()')
#     CHECK_DESC = ('N326 Translated messages cannot be concatenated.  '
#                   'String should be included in translated message.')
#     TRANS_FUNC = ['_', '_LI', '_LW', '_LE', '_LC']
# class BaseASTChecker(ast.NodeVisitor):
# class CheckForStrUnicodeExc(BaseASTChecker):
# class CheckForTransAdd(BaseASTChecker):
#     def __init__(self, tree, filename):
#     def run(self):
#     def add_error(self, node, message=None):
#     def _check_call_names(self, call_node, names):
# def use_timeutils_utcnow(logical_line, filename):
# def capital_cfg_help(logical_line, tokens):
# def assert_true_instance(logical_line):
# def assert_equal_type(logical_line):
# def assert_equal_none(logical_line):
# def no_translate_logs(logical_line):
# def no_import_translation_in_tests(logical_line, filename):
# def no_setting_conf_directly_in_tests(logical_line, filename):
# def no_mutable_default_args(logical_line):
# def check_explicit_underscore_import(logical_line, filename):
# def use_jsonutils(logical_line, filename):
#     def __init__(self, tree, filename):
#     def visit_TryExcept(self, node):
#     def visit_Call(self, node):
#     def visit_BinOp(self, node):
# def assert_true_or_false_with_in(logical_line):
# def assert_raises_regexp(logical_line):
# def dict_constructor_with_list_copy(logical_line):
# def assert_equal_in(logical_line):
# def assert_ctypes_libs_not_used_directly(logical_line, filename):
# def _get_module_src(path):
# def assert_ctypes_foreign_func_argtypes_defined(logical_line):
# 
# Path: os_win/tests/unit/test_base.py
# class TestingException(Exception):
# class FakeWMIExc(exceptions.x_wmi):
# class BaseTestCase(base.BaseTestCase):
# class OsWinBaseTestCase(BaseTestCase):
#     def __init__(self, hresult=None):
#     def setUp(self):
#     def _patch_autospec_classes(self):
#     def setUp(self):


import os
import textwrap
import pycodestyle
from unittest import mock
from os_win._hacking import checks
from os_win.tests.unit import test_base
        self._assert_has_errors(code, checker, filename=filename)

    def test_ctypes_libs_not_used_directly(self):
        checker = checks.assert_ctypes_libs_not_used_directly
        errors = [(1, 0, 'O301')]

        code = "ctypes.cdll.hbaapi"
        self._assert_has_errors(code, checker, expected_errors=errors)

        code = "ctypes.windll.hbaapi.fake_func(fake_arg)"
        self._assert_has_errors(code, checker, expected_errors=errors)

        code = "fake_var = ctypes.oledll.hbaapi.fake_func(fake_arg)"
        self._assert_has_errors(code, checker, expected_errors=errors)

        code = "foo(ctypes.pydll.hbaapi.fake_func(fake_arg))"
        self._assert_has_errors(code, checker, expected_errors=errors)

        code = "ctypes.cdll.LoadLibrary(fake_lib)"
        self._assert_has_errors(code, checker, expected_errors=errors)

        code = "ctypes.WinDLL('fake_lib_path')"
        self._assert_has_errors(code, checker, expected_errors=errors)

        code = "ctypes.cdll.hbaapi"
        filename = os.path.join("os_win", "utils", "winapi",
                                "libs", "hbaapi.py")
        self._assert_has_no_errors(code, checker, filename=filename)

    def test_ctypes_foreign_func_argtypes_defined(self):

# Path: os_win/_hacking/checks.py
# UNDERSCORE_IMPORT_FILES = []
#     CHECK_DESC = ('N325 str() and unicode() cannot be used on an '
#                   'exception.  Remove or use six.text_type()')
#     CHECK_DESC = ('N326 Translated messages cannot be concatenated.  '
#                   'String should be included in translated message.')
#     TRANS_FUNC = ['_', '_LI', '_LW', '_LE', '_LC']
# class BaseASTChecker(ast.NodeVisitor):
# class CheckForStrUnicodeExc(BaseASTChecker):
# class CheckForTransAdd(BaseASTChecker):
#     def __init__(self, tree, filename):
#     def run(self):
#     def add_error(self, node, message=None):
#     def _check_call_names(self, call_node, names):
# def use_timeutils_utcnow(logical_line, filename):
# def capital_cfg_help(logical_line, tokens):
# def assert_true_instance(logical_line):
# def assert_equal_type(logical_line):
# def assert_equal_none(logical_line):
# def no_translate_logs(logical_line):
# def no_import_translation_in_tests(logical_line, filename):
# def no_setting_conf_directly_in_tests(logical_line, filename):
# def no_mutable_default_args(logical_line):
# def check_explicit_underscore_import(logical_line, filename):
# def use_jsonutils(logical_line, filename):
#     def __init__(self, tree, filename):
#     def visit_TryExcept(self, node):
#     def visit_Call(self, node):
#     def visit_BinOp(self, node):
# def assert_true_or_false_with_in(logical_line):
# def assert_raises_regexp(logical_line):
# def dict_constructor_with_list_copy(logical_line):
# def assert_equal_in(logical_line):
# def assert_ctypes_libs_not_used_directly(logical_line, filename):
# def _get_module_src(path):
# def assert_ctypes_foreign_func_argtypes_defined(logical_line):
# 
# Path: os_win/tests/unit/test_base.py
# class TestingException(Exception):
# class FakeWMIExc(exceptions.x_wmi):
# class BaseTestCase(base.BaseTestCase):
# class OsWinBaseTestCase(BaseTestCase):
#     def __init__(self, hresult=None):
#     def setUp(self):
#     def _patch_autospec_classes(self):
#     def setUp(self):


# Path: os_win/tests/unit/test_hacking.py
import os
import textwrap
import pycodestyle
from unittest import mock
from os_win._hacking import checks
from os_win.tests.unit import test_base

        self._assert_has_errors(code, checker, filename=filename)

    def test_ctypes_libs_not_used_directly(self):
        checker = checks.assert_ctypes_libs_not_used_directly
        errors = [(1, 0, 'O301')]

        code = "ctypes.cdll.hbaapi"
        self._assert_has_errors(code, checker, expected_errors=errors)

        code = "ctypes.windll.hbaapi.fake_func(fake_arg)"
        self._assert_has_errors(code, checker, expected_errors=errors)

        code = "fake_var = ctypes.oledll.hbaapi.fake_func(fake_arg)"
        self._assert_has_errors(code, checker, expected_errors=errors)

        code = "foo(ctypes.pydll.hbaapi.fake_func(fake_arg))"
        self._assert_has_errors(code, checker, expected_errors=errors)

        code = "ctypes.cdll.LoadLibrary(fake_lib)"
        self._assert_has_errors(code, checker, expected_errors=errors)

        code = "ctypes.WinDLL('fake_lib_path')"
        self._assert_has_errors(code, checker, expected_errors=errors)

        code = "ctypes.cdll.hbaapi"
        filename = os.path.join("os_win", "utils", "winapi",
                                "libs", "hbaapi.py")
        self._assert_has_no_errors(code, checker, filename=filename)

    def test_ctypes_foreign_func_argtypes_defined(self):

        checker = checks.assert_ctypes_foreign_func_argtypes_defined