summaryrefslogtreecommitdiffstats
path: root/tests/command_manager.py
blob: d33de75511f54a04d0f1da03022280a3b92112e5 (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
36
37
# -*- 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>"

import unittest

import _bootstrap  # known W402, required

from clufter.format_manager import FormatManager
from clufter.filter_manager import FilterManager
from clufter.command_manager import CommandManager
from clufter.commands.ccs2pcs import ccs2pcs_needle


class CommandManagerTestCase(unittest.TestCase):
    def setUp(self):
        self.cmd_mgr = CommandManager(FilterManager(FormatManager()))

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


if __name__ == '__main__':
    unittest.main()