Пример #1
0
    def test_plugin_entry_object_none(src_dir, plugin_type, entry_point_module,
                                      plugin_module_content):
        queue = Queue()
        plugin_importer.get_manifest(src_dir, entry_point_module, None,
                                     plugin_module_content, plugin_type, False,
                                     queue)

        message = str(queue.get('exception'))
        assert 'Plugin entry point object is None.' in message
Пример #2
0
    def test_plugin_entry_point_nonexistent(src_dir, plugin_type,
                                            entry_point_module, plugin_name,
                                            plugin_module_content):
        entry_point_name = "nonexistent entry point"
        queue = Queue()
        plugin_importer.get_manifest(src_dir, entry_point_module,
                                     entry_point_name, plugin_module_content,
                                     plugin_type, False, queue)

        message = str(queue.get('exception'))
        assert ("'{}' is not a symbol in module".format(entry_point_name)
                in message)
Пример #3
0
    def test_plugin_object_none(src_dir, plugin_type, entry_point_module,
                                plugin_name, plugin_module_content):
        none_entry_point = "none_entry_point"
        setattr(plugin_module_content, none_entry_point, None)

        queue = Queue()
        plugin_importer.get_manifest(src_dir, entry_point_module,
                                     none_entry_point, plugin_module_content,
                                     plugin_type, False, queue)

        message = str(queue.get('exception'))
        assert ('Plugin object retrieved from the entry point {} is'
                ' None'.format(none_entry_point)) in message
Пример #4
0
 def test_plugin_module_content_none(src_dir, plugin_type,
                                     entry_point_module,
                                     entry_point_object):
     queue = Queue()
     manifest = plugin_importer.get_manifest(src_dir, entry_point_module,
                                             entry_point_object, None,
                                             plugin_type, False, queue)
     assert manifest is None