Ejemplo n.º 1
0
    def setUpClass(cls):
        token = environ.get('KB_AUTH_TOKEN', None)
        cls.ctx = {'token': token, 'provenance': [{'service': 'data_api2',
            'method': 'please_never_use_it_in_production', 'method_params': []}],
            'authenticated': 1}
        config_file = environ.get('KB_DEPLOYMENT_CONFIG', None)
        cls.cfg = {}
        config = ConfigParser()
        config.read(config_file)
        for nameval in config.items('data_api2'):
            cls.cfg[nameval[0]] = nameval[1]
        cls.wsURL = cls.cfg['workspace-url']
        cls.wsClient = workspaceService(cls.wsURL, token=token)
        cls.serviceImpl = data_api2(cls.cfg)
        cls.obj_name="ReferenceGenomeAnnotations/kb|g.207118"

        cls.obj_name="ReferenceGenomeAnnotations/kb|g.217864"
        cls.feature='kb|g.207118.CDS.3237'
        cls.feature='kb|g.217864.CDS.11485'
        cls.gene='kb|g.217864.locus.10619'

        cls.obj_name="ReferenceGenomeAnnotations/kb|g.140057"
        cls.feature='kb|g.140057.CDS.2901'
        cls.gene='kb|g.140057.locus.2922'
        cls.mrna='kb|g.140057.mRNA.2840'
        cls.taxon= u'1779/523209/1'
        cls.assembly='1837/56/1'
Ejemplo n.º 2
0

def get_config():
    if not get_config_file():
        return None
    retconfig = {}
    config = ConfigParser()
    config.read(get_config_file())
    for nameval in config.items(get_service_name() or 'data_api2'):
        retconfig[nameval[0]] = nameval[1]
    return retconfig

config = get_config()

from data_api2.data_api2Impl import data_api2
impl_data_api2 = data_api2(config)


class JSONObjectEncoder(json.JSONEncoder):

    def default(self, obj):
        if isinstance(obj, set):
            return list(obj)
        if isinstance(obj, frozenset):
            return list(obj)
        if hasattr(obj, 'toJSONable'):
            return obj.toJSONable()
        return json.JSONEncoder.default(self, obj)

sync_methods = {}
async_run_methods = {}