'Stub the discovery service\'s program list and detail API endpoints.
Arguments:
programs (list): A list of programs. Both list and detail endpoints
will be stubbed using data from this list.'

def install_programs(self, programs):

    key = 'catalog.programs'
    uuids = []
    for program in programs:
        uuid = program['uuid']
        uuids.append(uuid)
        program_key = '{base}.{uuid}'.format(base=key, uuid=uuid)
        requests.put('{}/set_config'.format(CATALOG_STUB_URL), data={program_key: json.dumps(program)})
    requests.put('{}/set_config'.format(CATALOG_STUB_URL), data={key: json.dumps(uuids)})
