# Path: commotion_client/utils/extension_manager.py
# class ExtensionManager(object):
# class ConfigManager(object):
#     def __init__(self):
#     def get_user_settings(self):
#     def reset_settings_group(self):
#     def init_extension_libraries(self):
#     def set_library_defaults(self):
#     def init_libraries(self):
#     def init_extension_config(self, ext_type=None):
#     def check_installed(self, name=None):
#     def get_installed(self):
#     def load_core(self):
#     def install_loaded(self, ext_type=None):
#     def get_extension_from_property(self, key, val):
#     def get_property(self, name, key):
#     def load_user_interface(self, extension_name, gui):
#     def get_config(self, name):
#     def remove_extension_settings(self, name):
#     def save_settings(self, extension_config, extension_type="global"):
#     def __init__(self, path=None):
#     def has_configs(self):
#     def find(self, name=None):
#     def get_paths(self, directory):
#     def get(self, paths=None):
#     def load(self, path):


from PyQt4 import QtCore
from PyQt4 import QtGui
from commotion_client.utils import extension_manager
import unittest
import re
import os
import sys
import copy
import types
            for name in files:
                os.remove(os.path.join(root, name))
            for name in dirs:
                os.rmdir(os.path.join(root, name))

    def test_init(self):
        #init config without any paths and ensure that it does not error out and creates the appropriate empty items
        self.econfig = extension_manager.ConfigManager()
        self.assertEqual(self.econfig.configs, [])
        self.assertEqual(self.econfig.paths, [])
        self.assertEqual(self.econfig.directory, None)
        
        #show creation with an empty directory raises the proper error.
        with self.assertRaises(ValueError):
            self.full_config = extension_manager.ConfigManager("tests/temp/")

        #init config with a working directory and ensure that everything loads appropriately.
        self.full_config = extension_manager.ConfigManager("tests/mock/extensions")
        self.assertEqual(self.full_config.configs, [ {'parent': 'Testing',
                                                      'name': 'unit_test_mock',
                                                      'tests': 'units',
                                                      'settings': 'main',
                                                      'toolbar': 'test_bar',
                                                      'menu_item': 'A Mock Testing Object',
                                                      'main': 'main'} ])
        self.assertEqual(self.full_config.paths, [os.path.abspath("tests/mock/extensions/unit_test_mock")])
        self.assertEqual(self.full_config.directory, "tests/mock/extensions")
        
    def test_has_configs(self):
        #test without configs

# Path: commotion_client/utils/extension_manager.py
# class ExtensionManager(object):
# class ConfigManager(object):
#     def __init__(self):
#     def get_user_settings(self):
#     def reset_settings_group(self):
#     def init_extension_libraries(self):
#     def set_library_defaults(self):
#     def init_libraries(self):
#     def init_extension_config(self, ext_type=None):
#     def check_installed(self, name=None):
#     def get_installed(self):
#     def load_core(self):
#     def install_loaded(self, ext_type=None):
#     def get_extension_from_property(self, key, val):
#     def get_property(self, name, key):
#     def load_user_interface(self, extension_name, gui):
#     def get_config(self, name):
#     def remove_extension_settings(self, name):
#     def save_settings(self, extension_config, extension_type="global"):
#     def __init__(self, path=None):
#     def has_configs(self):
#     def find(self, name=None):
#     def get_paths(self, directory):
#     def get(self, paths=None):
#     def load(self, path):


# Path: tests/utils/extension_manager_tests.py
from PyQt4 import QtCore
from PyQt4 import QtGui
from commotion_client.utils import extension_manager
import unittest
import re
import os
import sys
import copy
import types

            for name in files:
                os.remove(os.path.join(root, name))
            for name in dirs:
                os.rmdir(os.path.join(root, name))

    def test_init(self):
        #init config without any paths and ensure that it does not error out and creates the appropriate empty items
        self.econfig = extension_manager.ConfigManager()
        self.assertEqual(self.econfig.configs, [])
        self.assertEqual(self.econfig.paths, [])
        self.assertEqual(self.econfig.directory, None)
        
        #show creation with an empty directory raises the proper error.
        with self.assertRaises(ValueError):
            self.full_config = extension_manager.ConfigManager("tests/temp/")

        #init config with a working directory and ensure that everything loads appropriately.
        self.full_config = extension_manager.ConfigManager("tests/mock/extensions")
        self.assertEqual(self.full_config.configs, [ {'parent': 'Testing',
                                                      'name': 'unit_test_mock',
                                                      'tests': 'units',
                                                      'settings': 'main',
                                                      'toolbar': 'test_bar',
                                                      'menu_item': 'A Mock Testing Object',
                                                      'main': 'main'} ])
        self.assertEqual(self.full_config.paths, [os.path.abspath("tests/mock/extensions/unit_test_mock")])
        self.assertEqual(self.full_config.directory, "tests/mock/extensions")
        
    def test_has_configs(self):
        #test without configs

        self.empty_config = extension_manager.ConfigManager()