# 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
# http://www.apache.org/licenses/LICENSE-2.0 and a copy, including this
# notice, is available in the LICENSE file accompanying this software.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the # specific language governing permissions and limitations
# under the License.
#
##############################################################################
#




class TestModuleManager(testtools.TestCase):
    def fake_load_file(self, path):
        self.files_loaded += 1

    def test_load_directory_empty(self):
        with utils.temporary_directory() as path:
            self.files_loaded = 0

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

            self.assertEqual(self.files_loaded, 0)

    def test_load_directory_empty(self):

# 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

# http://www.apache.org/licenses/LICENSE-2.0 and a copy, including this
# notice, is available in the LICENSE file accompanying this software.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the # specific language governing permissions and limitations
# under the License.
#
##############################################################################
#




class TestModuleManager(testtools.TestCase):
    def fake_load_file(self, path):
        self.files_loaded += 1

    def test_load_directory_empty(self):
        with utils.temporary_directory() as path:
            self.files_loaded = 0

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

            self.assertEqual(self.files_loaded, 0)

    def test_load_directory_empty(self):

        with utils.temporary_directory() as path: