Showing
4 changed files
with
39 additions
and
5 deletions
@@ -1237,7 +1237,7 @@ Library openprocurement_client.utils | @@ -1237,7 +1237,7 @@ Library openprocurement_client.utils | ||
1237 | Set To Dictionary ${USERS.users['${username}']} bid_access_token=${reply.access.token} | 1237 | Set To Dictionary ${USERS.users['${username}']} bid_access_token=${reply.access.token} |
1238 | ${tender}= set_access_key ${tender} ${USERS.users['${username}'].bid_access_token} | 1238 | ${tender}= set_access_key ${tender} ${USERS.users['${username}'].bid_access_token} |
1239 | ${procurementMethodType}= Get variable value ${USERS.users['${username}'].tender_data.data.procurementMethodType} | 1239 | ${procurementMethodType}= Get variable value ${USERS.users['${username}'].tender_data.data.procurementMethodType} |
1240 | - ${methods}= Create List competitiveDialogueUA competitiveDialogueEU competitiveDialogueEU.stage2 aboveThresholdEU closeFrameworkAgreementUA | 1240 | + ${methods}= Create List competitiveDialogueUA competitiveDialogueEU competitiveDialogueEU.stage2 aboveThresholdEU closeFrameworkAgreementUA esco |
1241 | ${status}= Set Variable If '${procurementMethodType}' in ${methods} pending active | 1241 | ${status}= Set Variable If '${procurementMethodType}' in ${methods} pending active |
1242 | Set To Dictionary ${reply['data']} status=${status} | 1242 | Set To Dictionary ${reply['data']} status=${status} |
1243 | ${reply_active}= Call Method ${USERS.users['${username}'].client} patch_bid | 1243 | ${reply_active}= Call Method ${USERS.users['${username}'].client} patch_bid |
@@ -443,6 +443,32 @@ def test_bid_value(max_value_amount): | @@ -443,6 +443,32 @@ def test_bid_value(max_value_amount): | ||
443 | }) | 443 | }) |
444 | 444 | ||
445 | 445 | ||
446 | +def test_bid_value_esco(tender_data): | ||
447 | + annual_cost = [] | ||
448 | + for i in range(0, 21): | ||
449 | + cost=round(random.uniform(1, 100), 2) | ||
450 | + annual_cost.append(cost) | ||
451 | + if tender_data['fundingKind'] == "budget": | ||
452 | + yearly_percentage=round(random.uniform(0.01, float(tender_data['yearlyPaymentsPercentageRange'])), 5) | ||
453 | + else: | ||
454 | + yearly_percentage= 0.8 | ||
455 | + # when tender fundingKind is budget, yearlyPaymentsPercentageRange should be less or equal 0.8, and more or equal 0 | ||
456 | + # when tender fundingKind is other, yearlyPaymentsPercentageRange should be equal 0.8 | ||
457 | + return munchify({ | ||
458 | + "value": { | ||
459 | + "currency": "UAH", | ||
460 | + "valueAddedTaxIncluded": True, | ||
461 | + "yearlyPaymentsPercentage": yearly_percentage, | ||
462 | + "annualCostsReduction": annual_cost, | ||
463 | + "contractDuration": { | ||
464 | + "years": random.randint(7, 14), | ||
465 | + "days": random.randint(1, 364) | ||
466 | + } | ||
467 | + } | ||
468 | + }) | ||
469 | + | ||
470 | + | ||
471 | + | ||
446 | def test_supplier_data(): | 472 | def test_supplier_data(): |
447 | return munchify({ | 473 | return munchify({ |
448 | "data": { | 474 | "data": { |
@@ -289,7 +289,6 @@ Get Broker Property By Username | @@ -289,7 +289,6 @@ Get Broker Property By Username | ||
289 | 289 | ||
290 | 290 | ||
291 | Підготувати дані для подання пропозиції | 291 | Підготувати дані для подання пропозиції |
292 | - [Arguments] | ||
293 | ${bid}= generate_test_bid_data ${USERS.users['${tender_owner}'].initial_data.data} | 292 | ${bid}= generate_test_bid_data ${USERS.users['${tender_owner}'].initial_data.data} |
294 | [Return] ${bid} | 293 | [Return] ${bid} |
295 | 294 |
@@ -30,6 +30,7 @@ from .initial_data import ( | @@ -30,6 +30,7 @@ from .initial_data import ( | ||
30 | field_with_id, | 30 | field_with_id, |
31 | test_bid_data, | 31 | test_bid_data, |
32 | test_bid_value, | 32 | test_bid_value, |
33 | + test_bid_value_esco, | ||
33 | test_change_data, | 34 | test_change_data, |
34 | test_claim_answer_data, | 35 | test_claim_answer_data, |
35 | test_claim_data, | 36 | test_claim_data, |
@@ -605,7 +606,8 @@ def generate_test_bid_data(tender_data): | @@ -605,7 +606,8 @@ def generate_test_bid_data(tender_data): | ||
605 | 'aboveThresholdEU', | 606 | 'aboveThresholdEU', |
606 | 'competitiveDialogueUA', | 607 | 'competitiveDialogueUA', |
607 | 'competitiveDialogueEU', | 608 | 'competitiveDialogueEU', |
608 | - 'closeFrameworkAgreementUA' | 609 | + 'closeFrameworkAgreementUA', |
610 | + 'esco' | ||
609 | ): | 611 | ): |
610 | bid = test_bid_competitive_data() | 612 | bid = test_bid_competitive_data() |
611 | bid.data.selfEligible = True | 613 | bid.data.selfEligible = True |
@@ -615,11 +617,18 @@ def generate_test_bid_data(tender_data): | @@ -615,11 +617,18 @@ def generate_test_bid_data(tender_data): | ||
615 | if 'lots' in tender_data: | 617 | if 'lots' in tender_data: |
616 | bid.data.lotValues = [] | 618 | bid.data.lotValues = [] |
617 | for lot in tender_data['lots']: | 619 | for lot in tender_data['lots']: |
618 | - value = test_bid_value(lot['value']['amount']) | 620 | + if tender_data.get('procurementMethodType', '') == 'esco': |
621 | + value = test_bid_value_esco(tender_data) | ||
622 | + else: | ||
623 | + value = test_bid_value(lot['value']['amount']) | ||
619 | value['relatedLot'] = lot.get('id', '') | 624 | value['relatedLot'] = lot.get('id', '') |
620 | bid.data.lotValues.append(value) | 625 | bid.data.lotValues.append(value) |
621 | else: | 626 | else: |
622 | - bid.data.update(test_bid_value(tender_data['value']['amount'])) | 627 | + if tender_data.get('procurementMethodType', '') == 'esco': |
628 | + value = test_bid_value(tender_data) | ||
629 | + bid.data.update(value) | ||
630 | + else: | ||
631 | + bid.data.update(test_bid_value(tender_data['value']['amount'])) | ||
623 | if 'features' in tender_data: | 632 | if 'features' in tender_data: |
624 | bid.data.parameters = [] | 633 | bid.data.parameters = [] |
625 | for feature in tender_data['features']: | 634 | for feature in tender_data['features']: |
Please
register
or
login
to post a comment