# Path: opencenteragent/modules/manager.py
# LOG = logging.getLogger('opencenter.manager')
# class Manager(object):
#     def __init__(self, path, config={}):
#     def _load_directory(self, path):
#     def _load_file(self, path):
#     def register_action(self, plugin, action, method,
#                         constraints=[],
#                         consequences=[],
#                         args={}):
#     def load(self, path):
#     def stop(self):
# 
# Path: opencenteragent/utils.py
# def detailed_exception():
# def temporary_file():
# def temporary_directory():


import fixtures
import os
import testtools
import unittest
from opencenteragent.modules import manager
from opencenteragent import utils
            with open(os.path.join(path, 'file.py'), 'w') as f:
                f.write('fdsjkghfgjk')

            self.files_loaded = 0

            m = manager.Manager(path)
            m._load_file = self.fake_load_file
            m._load_directory(path)

            self.assertEqual(self.files_loaded, 1)

    def test_load_file(self):
        with utils.temporary_directory() as path:
            subdir_path = os.path.join(path, 'dir')
            os.mkdir(subdir_path)
            single_file = os.path.join(path, 'file.py')
            with open(single_file, 'w') as f:
                f.write('fdsjkghfgjk')
            with open(os.path.join(subdir_path, 'file.py'), 'w') as f:
                f.write('fdsjkghfgjk')
            with open(os.path.join(subdir_path, 'file2.py'), 'w') as f:
                f.write('fdsjkghfgjk')

            self.files_loaded = 0
            m = manager.Manager(single_file)
            m._load_file = self.fake_load_file
            m.load(single_file)
            self.assertEqual(self.files_loaded, 1)

            self.files_loaded = 0

# Path: opencenteragent/modules/manager.py
# LOG = logging.getLogger('opencenter.manager')
# class Manager(object):
#     def __init__(self, path, config={}):
#     def _load_directory(self, path):
#     def _load_file(self, path):
#     def register_action(self, plugin, action, method,
#                         constraints=[],
#                         consequences=[],
#                         args={}):
#     def load(self, path):
#     def stop(self):
# 
# Path: opencenteragent/utils.py
# def detailed_exception():
# def temporary_file():
# def temporary_directory():


# Path: tests/test_modules_manager.py
import fixtures
import os
import testtools
import unittest
from opencenteragent.modules import manager
from opencenteragent import utils

            with open(os.path.join(path, 'file.py'), 'w') as f:
                f.write('fdsjkghfgjk')

            self.files_loaded = 0

            m = manager.Manager(path)
            m._load_file = self.fake_load_file
            m._load_directory(path)

            self.assertEqual(self.files_loaded, 1)

    def test_load_file(self):
        with utils.temporary_directory() as path:
            subdir_path = os.path.join(path, 'dir')
            os.mkdir(subdir_path)
            single_file = os.path.join(path, 'file.py')
            with open(single_file, 'w') as f:
                f.write('fdsjkghfgjk')
            with open(os.path.join(subdir_path, 'file.py'), 'w') as f:
                f.write('fdsjkghfgjk')
            with open(os.path.join(subdir_path, 'file2.py'), 'w') as f:
                f.write('fdsjkghfgjk')

            self.files_loaded = 0
            m = manager.Manager(single_file)
            m._load_file = self.fake_load_file
            m.load(single_file)
            self.assertEqual(self.files_loaded, 1)

            self.files_loaded = 0

            m = manager.Manager(subdir_path)