summaryrefslogtreecommitdiffstats
path: root/tests/command_manager.py
blob: 685629dd69ca734cab9da3ba51c335bac101ac7f (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
32
33
34
35
# -*- coding: UTF-8 -*-
# Copyright 2014 Red Hat, Inc.
# Part of clufter project
# Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt)
"""Testing command manager"""
__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>"

from os.path import join, dirname as d; execfile(join(d(d((__file__))), '_go'))


from unittest import TestCase

from .command_manager import CommandManager
from .commands.ccs2pcs import ccs2pcs_needle


class CommandManagerTestCase(TestCase):
    def setUp(self):
        self.cmd_mgr = CommandManager.init_lookup()

    def tearDown(self):
        self.cmd_mgr.registry.setup(True)  # start from scratch
        self.cmd_mgr = None


class Default(CommandManagerTestCase):
    def test_default(self):
        commands = self.cmd_mgr.commands
        #print commands
        for cls in (ccs2pcs_needle, ):
            self.assertTrue(cls.name in commands)
            self.assertEqual(cls, type(commands[cls.name]))


from os.path import join, dirname as d; execfile(join(d(__file__), '_gone'))