Example #1
0
 def test_load_class(self):
     """
     Testing loading a plugin that looks for a specific class
     """
     def method(Klass):
         global WAS_RUN, CLASSES
         WAS_RUN = True
         self.assertTrue(issubclass(Klass, (TestPlugin)))
 
     load_app_plugin(TESTING_MODULE, TestPlugin, method)
     self.assertTrue(WAS_RUN)
Example #2
0
    def test_load_module_with_method(self):
        """
        test loading a module using a method to process it
        """
        def method(module):
            global WAS_RUN
            WAS_RUN = True
            self.assertTrue(hasattr(module, 'AN_INTEGER'))
            self.assertEqual(1, module.AN_INTEGER)

        load_app_plugin(TESTING_MODULE, method=method)
        self.assertTrue(WAS_RUN)
Example #3
0
 def fail():
     load_app_plugin(TESTING_MODULE, TestPlugin)
Example #4
0
 def fail():
     load_app_plugin('tests.apps.load_app_plugin.file_for_testing_module_error')
Example #5
0
 def test_load_module(self):
     """
     Test Loading a plugin that just needs to load a module
     """
     load_app_plugin('tests.apps.load_app_plugin.file_for_test_load_module')
     self.assertTrue(verify.MODULE_LOADED)
def initialize():
    """
    Initialize the app settings module
    """
    print "Loading Muddle Shots"
    load_app_plugin("muddle.mixers")