[Tests] Update plugin metadata test
This commit is contained in:
parent
14e775cbcf
commit
76cc3e79b9
|
@ -1,10 +1,30 @@
|
|||
from __future__ import print_function
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2015 Calum Lind <calumlind@gmail.com>
|
||||
#
|
||||
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
||||
# the additional special exception to link portions of this program with the OpenSSL library.
|
||||
# See LICENSE for more details.
|
||||
#
|
||||
|
||||
import deluge.pluginmanagerbase
|
||||
from deluge.pluginmanagerbase import PluginManagerBase
|
||||
|
||||
pm = deluge.pluginmanagerbase.PluginManagerBase("core.conf", "deluge.plugin.core")
|
||||
from . import common
|
||||
from .basetest import BaseTestCase
|
||||
|
||||
for p in pm.get_available_plugins():
|
||||
print("Plugin: %s" % (p))
|
||||
for k, v in pm.get_plugin_info(p).items():
|
||||
print("%s: %s" % (k, v))
|
||||
|
||||
class PluginManagerBaseTestCase(BaseTestCase):
|
||||
|
||||
def set_up(self):
|
||||
common.set_tmp_config_dir()
|
||||
|
||||
def test_get_plugin_info(self):
|
||||
pm = PluginManagerBase("core.conf", "deluge.plugin.core")
|
||||
for p in pm.get_available_plugins():
|
||||
for key, value in pm.get_plugin_info(p).items():
|
||||
self.assertTrue(isinstance("%s: %s" % (key, value), basestring))
|
||||
|
||||
def test_get_plugin_info_invalid_name(self):
|
||||
pm = PluginManagerBase("core.conf", "deluge.plugin.core")
|
||||
for key, value in pm.get_plugin_info("random").items():
|
||||
self.assertEqual(value, "not available")
|
||||
|
|
Loading…
Reference in New Issue