diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-01-20 10:05:07 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2014-01-20 10:06:15 +0100 |
commit | 85c04b1c6dc66f06c952a4097a1afde9750d2d18 (patch) | |
tree | acd56fa8cc93d7f88f1b26b1a6f66fdf293dc8a5 /tests/command_manager.py | |
parent | dc1842974a40b1a537a3fc812c473a1b9c447602 (diff) | |
download | clufter-85c04b1c6dc66f06c952a4097a1afde9750d2d18.tar.gz clufter-85c04b1c6dc66f06c952a4097a1afde9750d2d18.tar.xz clufter-85c04b1c6dc66f06c952a4097a1afde9750d2d18.zip |
command_manager: add some unit tests
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'tests/command_manager.py')
-rw-r--r-- | tests/command_manager.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/command_manager.py b/tests/command_manager.py new file mode 100644 index 0000000..ad454fb --- /dev/null +++ b/tests/command_manager.py @@ -0,0 +1,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 filter 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 + + +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, ): + self.assertTrue(cls.name in commands) + self.assertEqual(cls, type(commands[cls.name])) + + +if __name__ == '__main__': + unittest.main() |