Esempio n. 1
0
 def test_get_app(self, plugins, subclasses):
     mock_app = MagicMock('Mock App')
     plugin = MagicMock()
     plugins.return_value = [plugin]
     subclasses.return_value = [mock_app]
     self.assertEqual([plugin, mock_app],
                      list(application.get_all_components()))
 def test_get_app(self, plugins, subclasses):
     mock_app = MagicMock('Mock App')
     plugin = MagicMock()
     plugins.return_value = [plugin]
     subclasses.return_value = [mock_app]
     self.assertEqual(
         [plugin, mock_app], list(application.get_all_components())
     )
Esempio n. 3
0
    def handle(self, *args, **options):
        if options.get('filename', None):
            return self.handle_explicit_filename(**options)

        components = application.get_all_components()
        for component in components:

            self.set_counter()

            self.from_component(component)
            self.print_status(component.__name__)
Esempio n. 4
0
 def handle(self, *args, **options):
     application_and_plugins = application.get_all_components()
     for plugin in application_and_plugins:
         data = self._from_file(plugin)
         msg = "\nFor {}".format(plugin.__name__)
         num, created, synonyms_created = load_lookuplist(data)
         msg += "\nLoaded {0} lookup lists\n".format(num)
         msg += "\n\nNew items report:\n\n\n"
         msg += "{0} new items".format(created)
         msg += " {0} new synonyms".format(synonyms_created)
         self.stdout.write(msg)
Esempio n. 5
0
    def handle(self, *args, **options):
        if options.get('filename', None):
            return self.handle_explicit_filename(**options)

        components = application.get_all_components()
        for component in components:

            self.set_counter()

            self.from_component(component)
            self.print_status(component.__name__)
Esempio n. 6
0
    def handle(self, *args, **options):
        components = application.get_all_components()
        for component in components:

            self.set_counter()

            self.from_component(component)

            msg = "\nFor {}".format(component.__name__)
            msg += "\nLoaded {0} lookup lists\n".format(self.num)
            msg += "\n\nNew items report:\n\n\n"
            msg += "{0} new items".format(self.created)
            msg += " {0} new synonyms".format(self.synonyms)

            self.stdout.write(msg)