def __init__(self): QconfCli.__init__(self) self.api = QconfApi() self.add_option( '', '--input-file', dest='input_file', help='Input file containing object\'s JSON representation.') self.add_option('', '--to-uge', dest='target_uge_version', default=self.api.get_uge_version(), help='Target UGE version (default: %s).' % self.api.get_uge_version()) self.add_option( '', '--output-format', dest='output_format', default='json', help='Output format, either json or uge (default: json).')
import types from nose import SkipTest from .utils import needs_uge from .utils import generate_random_string from .utils import create_config_file from .utils import load_values from uge.api.qconf_api import QconfApi from uge.config.config_manager import ConfigManager from uge.log.log_manager import LogManager from uge.exceptions.object_not_found import ObjectNotFound from uge.exceptions.object_already_exists import ObjectAlreadyExists create_config_file() API = QconfApi() HOST_GROUP_NAME = '@%s' % generate_random_string(6) CONFIG_MANAGER = ConfigManager.get_instance() HOST_NAME = CONFIG_MANAGER['host'] LOG_MANAGER = LogManager.get_instance() VALUES_DICT = load_values('test_values.json') print(VALUES_DICT) @needs_uge def test_generate_hgrp(): hgrp = API.generate_hgrp(HOST_GROUP_NAME) assert (hgrp.data['group_name'] == HOST_GROUP_NAME) def test_list_hgrps():