Commit 62f159a2f447c4efbebc5ab26cb46308df49cd5b
Committed by
GitHub
Merge pull request #83 from openprocurement/master
remove ds_client and add ds_config
Showing
2 changed files
with
13 additions
and
16 deletions
| ... | ... | @@ -68,14 +68,12 @@ Library openprocurement_client.utils |
| 68 | 68 | ${auth_ds}= set variable ${auth_ds_all.${RESOURCE}} |
| 69 | 69 | Log ${auth_ds} |
| 70 | 70 | |
| 71 | -# Uncomment this line if there is need to process files operations without DS. | |
| 72 | -# ${ds_api_wraper}= set variable ${None} | |
| 73 | - ${ds_api_wraper}= prepare_ds_api_wrapper ${DS_HOST_URL} ${auth_ds} | |
| 71 | + ${ds_config}= Create Dictionary host_url=${ds_host_url} auth_ds=${auth_ds} | |
| 74 | 72 | ${api_wrapper}= Run Keyword If '${RESOURCE}' == 'plans' |
| 75 | 73 | ... prepare_plan_api_wrapper ${USERS.users['${username}'].api_key} PLANS ${API_HOST_URL} ${API_VERSION} |
| 76 | - ... ELSE prepare_api_wrapper ${USERS.users['${username}'].api_key} ${RESOURCE} ${API_HOST_URL} ${API_VERSION} ${ds_api_wraper} | |
| 77 | - ${dasu_api_wraper}= prepare_dasu_api_wrapper ${USERS.users['${username}'].dasu_api_key} ${DASU_RESOURCE} ${DASU_API_HOST_URL} ${DASU_API_VERSION} ${ds_api_wraper} | |
| 78 | - ${agreement_wrapper}= prepare_agreement_api_wrapper ${USERS.users['${username}'].api_key} AGREEMENTS ${API_HOST_URL} ${API_VERSION} ${ds_api_wraper} | |
| 74 | + ... ELSE prepare_api_wrapper ${USERS.users['${username}'].api_key} ${RESOURCE} ${API_HOST_URL} ${API_VERSION} ${ds_config} | |
| 75 | + ${dasu_api_wraper}= prepare_dasu_api_wrapper ${USERS.users['${username}'].dasu_api_key} ${DASU_RESOURCE} ${DASU_API_HOST_URL} ${DASU_API_VERSION} ${ds_config} | |
| 76 | + ${agreement_wrapper}= prepare_agreement_api_wrapper ${USERS.users['${username}'].api_key} AGREEMENTS ${API_HOST_URL} ${API_VERSION} ${ds_config} | |
| 79 | 77 | Set To Dictionary ${USERS.users['${username}']} client=${api_wrapper} |
| 80 | 78 | Set To Dictionary ${USERS.users['${username}']} agreement_client=${agreement_wrapper} |
| 81 | 79 | Set To Dictionary ${USERS.users['${username}']} dasu_client=${dasu_api_wraper} |
| ... | ... | @@ -87,7 +85,7 @@ Library openprocurement_client.utils |
| 87 | 85 | ${edr_wrapper}= prepare_edr_wrapper ${EDR_HOST_URL} ${EDR_VERSION} ${USERS.users['${username}'].auth_edr[0]} ${USERS.users['${username}'].auth_edr[1]} |
| 88 | 86 | Set To Dictionary ${USERS.users['${username}']} edr_client=${edr_wrapper} |
| 89 | 87 | #Variables for contracting_management module |
| 90 | - ${contract_api_wrapper}= prepare_contract_api_wrapper ${USERS.users['${username}'].api_key} CONTRACTS ${api_host_url} ${api_version} ${ds_api_wraper} | |
| 88 | + ${contract_api_wrapper}= prepare_contract_api_wrapper ${USERS.users['${username}'].api_key} CONTRACTS ${api_host_url} ${api_version} ${ds_config} | |
| 91 | 89 | Set To Dictionary ${USERS.users['${username}']} contracting_client=${contract_api_wrapper} |
| 92 | 90 | Set To Dictionary ${USERS.users['${username}']} contract_access_token=${EMPTY} |
| 93 | 91 | Set To Dictionary ${USERS.users['${username}']} agreement_access_token=${EMPTY} | ... | ... |
| ... | ... | @@ -42,18 +42,18 @@ class StableAgreementClient(AgreementClient): |
| 42 | 42 | return super(StableAgreementClient, self).request(*args, **kwargs) |
| 43 | 43 | |
| 44 | 44 | |
| 45 | -def prepare_api_wrapper(key, resource, host_url, api_version, ds_client=None): | |
| 45 | +def prepare_api_wrapper(key, resource, host_url, api_version, ds_config=None): | |
| 46 | 46 | return StableClient(key, resource, host_url, api_version, |
| 47 | - ds_client=ds_client) | |
| 47 | + ds_config=ds_config) | |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | def prepare_ds_api_wrapper(ds_host_url, auth_ds): |
| 51 | 51 | return StableDsClient(ds_host_url, auth_ds) |
| 52 | 52 | |
| 53 | 53 | |
| 54 | -def prepare_agreement_api_wrapper(key, resource, host_url, api_version, ds_client=None): | |
| 54 | +def prepare_agreement_api_wrapper(key, resource, host_url, api_version, ds_config=None): | |
| 55 | 55 | return StableAgreementClient(key, resource, host_url, api_version, |
| 56 | - ds_client=ds_client) | |
| 56 | + ds_config=ds_config) | |
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | class ContractingStableClient(ContractingClient): |
| ... | ... | @@ -62,8 +62,8 @@ class ContractingStableClient(ContractingClient): |
| 62 | 62 | return super(ContractingStableClient, self).request(*args, **kwargs) |
| 63 | 63 | |
| 64 | 64 | |
| 65 | -def prepare_contract_api_wrapper(key, resource, host_url, api_version, ds_client=None): | |
| 66 | - return ContractingStableClient(key, resource, host_url, api_version, ds_client=ds_client) | |
| 65 | +def prepare_contract_api_wrapper(key, resource, host_url, api_version, ds_config=None): | |
| 66 | + return ContractingStableClient(key, resource, host_url, api_version, ds_config=ds_config) | |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | class StableEDRClient(EDRClient): |
| ... | ... | @@ -179,7 +179,6 @@ class StableClient_dasu(DasuClient): |
| 179 | 179 | return super(StableClient_dasu, self).request(*args, **kwargs) |
| 180 | 180 | |
| 181 | 181 | |
| 182 | -def prepare_dasu_api_wrapper(key, resource, host_url, api_version, ds_client=None): | |
| 183 | - print key | |
| 182 | +def prepare_dasu_api_wrapper(key, resource, host_url, api_version, ds_config=None): | |
| 184 | 183 | return StableClient_dasu(key, resource, host_url, api_version, |
| 185 | - ds_client=ds_client) | |
| \ No newline at end of file | ||
| 184 | + ds_config=ds_config) | |
| \ No newline at end of file | ... | ... |
Please
register
or
login
to post a comment