summaryrefslogtreecommitdiffstats
path: root/deluge/tests/test_plugin_metadata.py
blob: 436fc2c50d06bd6ba274b6be062c4f6d7675c557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- 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.
#

from __future__ import unicode_literals

from deluge.pluginmanagerbase import PluginManagerBase

from . import common
from .basetest import BaseTestCase


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), ''.__class__))

    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')