Example #1
0
    def test_get_version_string(self):
        """Test extracting a version string given a module string."""
        exp = pyqi.__version__

        obs = get_version_string('pyqi')
        self.assertEqual(obs, exp)

        obs = get_version_string('pyqi.interfaces.optparse.config')
        self.assertEqual(obs, exp)

        with self.assertRaises(ImportError):
            _ = get_version_string('hopefully.bogus.python.module')
Example #2
0
    def test_get_version_string(self):
        """Test extracting a version string given a module string."""
        exp = pyqi.__version__

        obs = get_version_string('pyqi')
        self.assertEqual(obs, exp)

        obs = get_version_string('pyqi.interfaces.optparse.config')
        self.assertEqual(obs, exp)

        with self.assertRaises(ImportError):
            _ = get_version_string('hopefully.bogus.python.module')
Example #3
0
def get_cmd_obj(cmd_cfg_mod, cmd):
    """Get a ``Command`` object"""
    cmd_cfg,_ = get_command_config(cmd_cfg_mod, cmd)
    version_str = get_version_string(cmd_cfg_mod)
    cmd_class = html_interface_factory(cmd_cfg.CommandConstructor, [],
                            cmd_cfg.inputs, cmd_cfg.outputs, version_str, cmd)
    cmd_obj = cmd_class()
    return cmd_obj
Example #4
0
def get_cmd_obj(cmd_cfg_mod, cmd):
    """Get a ``Command`` object"""
    cmd_cfg, _ = get_command_config(cmd_cfg_mod, cmd)
    version_str = get_version_string(cmd_cfg_mod)
    cmd_class = html_interface_factory(cmd_cfg.CommandConstructor, [],
                                       cmd_cfg.inputs, cmd_cfg.outputs,
                                       version_str, cmd)
    cmd_obj = cmd_class()
    return cmd_obj