Exemplo n.º 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)
Exemplo n.º 2
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)
Exemplo n.º 3
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)
Exemplo n.º 4
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)
Exemplo n.º 5
0
 def fail():
     load_app_plugin(TESTING_MODULE, TestPlugin)
Exemplo n.º 6
0
 def fail():
     load_app_plugin(
         'tests.apps.load_app_plugin.file_for_testing_module_error')
Exemplo n.º 7
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)
Exemplo n.º 8
0
 def fail():
     load_app_plugin(TESTING_MODULE, TestPlugin)
Exemplo n.º 9
0
 def fail():
     load_app_plugin(
         'tests.apps.load_app_plugin.file_for_testing_module_error')
Exemplo n.º 10
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)
Exemplo n.º 11
0
def initialize():
    """
    Initialize the app settings module
    """
    print 'Loading Muddle Shots'
    load_app_plugin('muddle.mixers')