# Path: infi/pyutils/patch.py
# class patch(object):
#     """ context manager for patching """
#     def __init__(self, module, name, replacement):
#         self._module = module
#         self._name = name
#         self._replacement = replacement
#         
#     def __enter__(self):
#         monkey_patch(self._module, self._name, self._replacement)
#         
#     def __exit__ (self, exc_type, exc_value, exc_tb):
#         unmonkey_patch(self._module, self._name)


import os
from infi.pyutils.patch import patch
from .test_utils import TestCase

def listdir_patch(path):
    return [path]

TEST_PATH = "__infi_test"

class EnumTestCase(TestCase):
    def test__patch_context(self):

# Path: infi/pyutils/patch.py
# class patch(object):
#     """ context manager for patching """
#     def __init__(self, module, name, replacement):
#         self._module = module
#         self._name = name
#         self._replacement = replacement
#         
#     def __enter__(self):
#         monkey_patch(self._module, self._name, self._replacement)
#         
#     def __exit__ (self, exc_type, exc_value, exc_tb):
#         unmonkey_patch(self._module, self._name)


# Path: tests/test__patch.py
import os
from infi.pyutils.patch import patch
from .test_utils import TestCase


def listdir_patch(path):
    return [path]

TEST_PATH = "__infi_test"

class EnumTestCase(TestCase):
    def test__patch_context(self):

        with patch(os, "listdir", listdir_patch):