Commit 4b39f7b06f49149aee1a28df7eee875fa3c70eba
1 parent
33d65dae
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,14 +68,12 @@ Library openprocurement_client.utils | ||
| 68 | ${auth_ds}= set variable ${auth_ds_all.${RESOURCE}} | 68 | ${auth_ds}= set variable ${auth_ds_all.${RESOURCE}} |
| 69 | Log ${auth_ds} | 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 | ${api_wrapper}= Run Keyword If '${RESOURCE}' == 'plans' | 72 | ${api_wrapper}= Run Keyword If '${RESOURCE}' == 'plans' |
| 75 | ... prepare_plan_api_wrapper ${USERS.users['${username}'].api_key} PLANS ${API_HOST_URL} ${API_VERSION} | 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 | Set To Dictionary ${USERS.users['${username}']} client=${api_wrapper} | 77 | Set To Dictionary ${USERS.users['${username}']} client=${api_wrapper} |
| 80 | Set To Dictionary ${USERS.users['${username}']} agreement_client=${agreement_wrapper} | 78 | Set To Dictionary ${USERS.users['${username}']} agreement_client=${agreement_wrapper} |
| 81 | Set To Dictionary ${USERS.users['${username}']} dasu_client=${dasu_api_wraper} | 79 | Set To Dictionary ${USERS.users['${username}']} dasu_client=${dasu_api_wraper} |
| @@ -87,7 +85,7 @@ Library openprocurement_client.utils | @@ -87,7 +85,7 @@ Library openprocurement_client.utils | ||
| 87 | ${edr_wrapper}= prepare_edr_wrapper ${EDR_HOST_URL} ${EDR_VERSION} ${USERS.users['${username}'].auth_edr[0]} ${USERS.users['${username}'].auth_edr[1]} | 85 | ${edr_wrapper}= prepare_edr_wrapper ${EDR_HOST_URL} ${EDR_VERSION} ${USERS.users['${username}'].auth_edr[0]} ${USERS.users['${username}'].auth_edr[1]} |
| 88 | Set To Dictionary ${USERS.users['${username}']} edr_client=${edr_wrapper} | 86 | Set To Dictionary ${USERS.users['${username}']} edr_client=${edr_wrapper} |
| 89 | #Variables for contracting_management module | 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 | Set To Dictionary ${USERS.users['${username}']} contracting_client=${contract_api_wrapper} | 89 | Set To Dictionary ${USERS.users['${username}']} contracting_client=${contract_api_wrapper} |
| 92 | Set To Dictionary ${USERS.users['${username}']} contract_access_token=${EMPTY} | 90 | Set To Dictionary ${USERS.users['${username}']} contract_access_token=${EMPTY} |
| 93 | Set To Dictionary ${USERS.users['${username}']} agreement_access_token=${EMPTY} | 91 | Set To Dictionary ${USERS.users['${username}']} agreement_access_token=${EMPTY} |
| @@ -42,18 +42,18 @@ class StableAgreementClient(AgreementClient): | @@ -42,18 +42,18 @@ class StableAgreementClient(AgreementClient): | ||
| 42 | return super(StableAgreementClient, self).request(*args, **kwargs) | 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 | return StableClient(key, resource, host_url, api_version, | 46 | return StableClient(key, resource, host_url, api_version, |
| 47 | - ds_client=ds_client) | 47 | + ds_config=ds_config) |
| 48 | 48 | ||
| 49 | 49 | ||
| 50 | def prepare_ds_api_wrapper(ds_host_url, auth_ds): | 50 | def prepare_ds_api_wrapper(ds_host_url, auth_ds): |
| 51 | return StableDsClient(ds_host_url, auth_ds) | 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 | return StableAgreementClient(key, resource, host_url, api_version, | 55 | return StableAgreementClient(key, resource, host_url, api_version, |
| 56 | - ds_client=ds_client) | 56 | + ds_config=ds_config) |
| 57 | 57 | ||
| 58 | 58 | ||
| 59 | class ContractingStableClient(ContractingClient): | 59 | class ContractingStableClient(ContractingClient): |
| @@ -62,8 +62,8 @@ class ContractingStableClient(ContractingClient): | @@ -62,8 +62,8 @@ class ContractingStableClient(ContractingClient): | ||
| 62 | return super(ContractingStableClient, self).request(*args, **kwargs) | 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 | class StableEDRClient(EDRClient): | 69 | class StableEDRClient(EDRClient): |
| @@ -181,7 +181,6 @@ class StableClient_dasu(DasuClient): | @@ -181,7 +181,6 @@ class StableClient_dasu(DasuClient): | ||
| 181 | return super(StableClient_dasu, self).request(*args, **kwargs) | 181 | return super(StableClient_dasu, self).request(*args, **kwargs) |
| 182 | 182 | ||
| 183 | 183 | ||
| 184 | -def prepare_dasu_api_wrapper(key, resource, host_url, api_version, ds_client=None): | ||
| 185 | - print key | 184 | +def prepare_dasu_api_wrapper(key, resource, host_url, api_version, ds_config=None): |
| 186 | return StableClient_dasu(key, resource, host_url, api_version, | 185 | return StableClient_dasu(key, resource, host_url, api_version, |
| 187 | - ds_client=ds_client) | ||
| 186 | + ds_config=ds_config) |
Please
register
or
login
to post a comment