tests.utils.extension_manager_tests.ExtensionLibraries Class Reference
Inheritance diagram for tests.utils.extension_manager_tests.ExtensionLibraries:
tests.utils.extension_manager_tests.ExtensionSettingsTestCase

Public Member Functions

def test_init_libraries
 
def test_install_loaded
 
def test_get_extension_from_property
 
def test_get_property
 
def test_load_user_interface
 
def test_get_config
 
def test_reset_settings_group
 
def test_remove_extension_settings
 
def test_save_settings
 
- Public Member Functions inherited from tests.utils.extension_manager_tests.ExtensionSettingsTestCase
def setUp
 
def tearDown
 

Additional Inherited Members

- Public Attributes inherited from tests.utils.extension_manager_tests.ExtensionSettingsTestCase
 app
 
 ext_mgr
 

Member Function Documentation

def tests.utils.extension_manager_tests.ExtensionLibraries.test_init_libraries (   self)
Tests that the library are created when provided and fail gracefully when not. 
170  def test_init_libraries(self):
171  """Tests that the library are created when provided and fail gracefully when not. """
172 
173  #init libraries from library defaults
174  self.ext_mgr.set_library_defaults()
175  user_dir = self.ext_mgr.libraries['user']
176  #Set global path to be a temporary path because it pulls the application path, which is pythons /usr/local/bin path which we don't have permissions for.
177  self.ext_mgr.libraries['global'] = os.path.abspath("tests/temp/")
178  global_dir = self.ext_mgr.libraries['global']
179  self.ext_mgr.init_libraries()
180  self.assertTrue(os.path.isdir(os.path.abspath(user_dir)))
181  self.assertTrue(os.path.isdir(os.path.abspath(global_dir)))
182  #assert that init libraries works with non-default paths.
183 
184  self.ext_mgr.libraries['user'] = os.path.abspath("tests/temp/oneLevel/")
185  self.ext_mgr.libraries['global'] = os.path.abspath("tests/temp/oneLevel/twoLevel/")
186  self.ext_mgr.init_libraries()
187  self.assertTrue(os.path.isdir(os.path.abspath("tests/temp/oneLevel/twoLevel/")))
188  self.assertTrue(os.path.isdir(os.path.abspath("tests/temp/oneLevel/")))
def test_init_libraries
Definition: extension_manager_tests.py:169
def tests.utils.extension_manager_tests.ExtensionLibraries.test_install_loaded (   self)
Tests that all loaded, and currently uninstalled, libraries are installed
190  def test_install_loaded(self):
191  """ Tests that all loaded, and currently uninstalled, libraries are installed"""
192  #setup directory with extension
193  self.ext_mgr.libraries['user'] = os.path.abspath("tests/mock/extensions/")
194  #setup empty directory
195  self.ext_mgr.libraries['global'] = os.path.abspath("tests/temp/global/")
196  #setup paths and configs
197  self.ext_mgr.init_libraries()
198  self.ext_mgr.init_extension_config("user")
199  self.ext_mgr.init_extension_config("global")
200  #Global is empty, so make sure it is not filled.
201  with self.assertRaises(KeyError):
202  self.ext_mgr.extensions['global'].has_configs()
203  #run function
204  user_installed = self.ext_mgr.install_loaded()
205  self.assertEqual(user_installed, ["unit_test_mock"])
206 
207  #Test that the mock extension was loaded
208  self.assertTrue(self.ext_mgr.check_installed("unit_test_mock"))
209  #Test that ONLY the mock extension was loaded and in the user section
210  one_item_only = self.ext_mgr.get_installed()
211  self.assertEqual(len(one_item_only), 1)
212  self.assertIn("unit_test_mock", one_item_only)
213  self.assertEqual(one_item_only['unit_test_mock'], 'user')
214  #Test that the config_manager was "initialized".
215  initialized = self.ext_mgr.get_extension_from_property("initialized", True)
216  self.assertIn("unit_test_mock", initialized)
def test_install_loaded
Definition: extension_manager_tests.py:189

The documentation for this class was generated from the following file:
  • tests/utils/extension_manager_tests.py