Commit 561c4d651b7bc4622e563b587e48397140ac4d3f
1 parent
c7c00a2a
Make test_confirm_data
Update other functions to work with Munch Delete test_change_cancellation_document_field_data
Showing
3 changed files
with
44 additions
and
51 deletions
... | ... | @@ -397,7 +397,7 @@ Library openprocurement_client_helper.py |
397 | 397 | ... [Return] Nothing |
398 | 398 | [Arguments] ${username} ${tender_uaid} ${award_num} |
399 | 399 | ${tender}= Пошук тендера по ідентифікатору ${username} ${tender_uaid} |
400 | - ${data}= test_confirm_supplier_data ${tender['data']['awards'][${award_num}]['id']} | |
400 | + ${data}= test_confirm_data ${tender['data']['awards'][${award_num}]['id']} | |
401 | 401 | Log ${data} |
402 | 402 | ${reply}= Call Method ${USERS.users['${username}'].client} patch_award ${tender} ${data} |
403 | 403 | Log ${reply} |
... | ... | @@ -439,7 +439,8 @@ Library openprocurement_client_helper.py |
439 | 439 | ... [Return] Nothing |
440 | 440 | [Arguments] ${username} ${tender_uaid} ${cancel_num} ${doc_num} ${field} ${value} |
441 | 441 | ${tender}= Пошук тендера по ідентифікатору ${username} ${tender_uaid} |
442 | - ${data}= test_change_cancellation_document_field_data ${field} ${value} | |
442 | + ${temp}= Create Dictionary ${field} ${value} | |
443 | + ${data}= Create Dictionary data ${temp} | |
443 | 444 | Log ${data} |
444 | 445 | ${reply}= Call Method ${USERS.users['${username}'].client} patch_cancellation_document ${tender} ${data} ${tender['data']['cancellations'][${cancel_num}]['id']} ${tender['data']['cancellations'][${cancel_num}]['documents'][${doc_num}]['id']} |
445 | 446 | Log ${reply} |
... | ... | @@ -466,7 +467,7 @@ Library openprocurement_client_helper.py |
466 | 467 | ... [Return] Nothing |
467 | 468 | [Arguments] ${username} ${tender_uaid} ${cancel_num} |
468 | 469 | ${tender}= Пошук тендера по ідентифікатору ${username} ${tender_uaid} |
469 | - ${data}= test_confirm_cancellation_data ${tender['data']['cancellations'][${cancel_num}]['id']} | |
470 | + ${data}= test_confirm_data ${tender['data']['cancellations'][${cancel_num}]['id']} | |
470 | 471 | Log ${data} |
471 | 472 | ${reply}= Call Method ${USERS.users['${username}'].client} patch_cancellation ${tender} ${data} |
472 | 473 | Log ${reply} |
... | ... | @@ -479,7 +480,7 @@ Library openprocurement_client_helper.py |
479 | 480 | ... [Return] Nothing |
480 | 481 | [Arguments] ${username} ${tender_uaid} ${contract_num} |
481 | 482 | ${tender}= Викликати для учасника ${username} Пошук тендера по ідентифікатору ${tender_uaid} |
482 | - ${data}= test_confirm_contract_data ${tender['data']['contracts'][${contract_num}]['id']} | |
483 | + ${data}= test_confirm_data ${tender['data']['contracts'][${contract_num}]['id']} | |
483 | 484 | Log ${data} |
484 | 485 | ${reply}= Call Method ${USERS.users['${username}'].client} patch_contract ${tender} ${data} |
485 | 486 | Log ${reply} | ... | ... |
... | ... | @@ -535,28 +535,28 @@ def test_claim_data(): |
535 | 535 | |
536 | 536 | |
537 | 537 | def test_complaint_answer_data(complaint_id): |
538 | - return { | |
538 | + return munchify({ | |
539 | 539 | "data": { |
540 | 540 | "id": complaint_id, |
541 | 541 | "status": "answered", |
542 | 542 | "resolutionType": "resolved", |
543 | 543 | "resolution": fake.sentence(nb_words=40, variable_nb_words=True) |
544 | 544 | } |
545 | - } | |
545 | + }) | |
546 | 546 | |
547 | 547 | |
548 | 548 | def test_claim_answer_satisfying_data(claim_id): |
549 | - return { | |
549 | + return munchify({ | |
550 | 550 | "data": { |
551 | 551 | "id": claim_id, |
552 | 552 | "status": "resolved", |
553 | 553 | "satisfied": True |
554 | 554 | } |
555 | - } | |
555 | + }) | |
556 | 556 | |
557 | 557 | |
558 | 558 | def test_claim_answer_data(claim_id): |
559 | - return { | |
559 | + return munchify({ | |
560 | 560 | "data": { |
561 | 561 | "status": "answered", |
562 | 562 | "resolutionType": "resolved", |
... | ... | @@ -564,86 +564,80 @@ def test_claim_answer_data(claim_id): |
564 | 564 | "resolution": fake.sentence(nb_words=15, variable_nb_words=True), |
565 | 565 | "id": claim_id |
566 | 566 | } |
567 | - } | |
567 | + }) | |
568 | + | |
568 | 569 | |
569 | 570 | def test_escalate_claim_data(claim_id): |
570 | - return { | |
571 | + return munchify({ | |
571 | 572 | "data": { |
572 | 573 | "status": "pending", |
573 | 574 | "satisfied": False, |
574 | 575 | "id": claim_id |
575 | 576 | } |
576 | - } | |
577 | + }) | |
577 | 578 | |
578 | 579 | |
579 | 580 | def test_cancel_tender_data(cancellation_reason): |
580 | - return { | |
581 | + return munchify({ | |
581 | 582 | 'data': { |
582 | 583 | 'reason': cancellation_reason |
583 | 584 | } |
584 | - } | |
585 | + }) | |
585 | 586 | |
586 | 587 | |
587 | 588 | def test_cancel_claim_data(claim_id, cancellation_reason): |
588 | - return { | |
589 | + return munchify({ | |
589 | 590 | 'data': { |
590 | 591 | 'cancellationReason': cancellation_reason, |
591 | 592 | 'status': 'cancelled', |
592 | 593 | 'id': claim_id |
593 | 594 | } |
594 | - } | |
595 | + }) | |
595 | 596 | |
596 | 597 | |
597 | 598 | def test_change_cancellation_document_field_data(key, value): |
598 | - data = { | |
599 | + return munchify({ | |
599 | 600 | "data": { |
600 | 601 | key: value |
601 | 602 | } |
602 | - } | |
603 | - return data | |
604 | - | |
603 | + }) | |
605 | 604 | |
606 | -def test_confirm_supplier_data(supplier_id): | |
607 | - return { | |
608 | - "data": { | |
609 | - "status": "active", | |
610 | - "id": supplier_id | |
611 | - } | |
612 | - } | |
613 | 605 | |
614 | 606 | |
615 | -def test_confirm_cancellation_data(cancellation_id): | |
616 | - data = { | |
607 | +def test_confirm_data(ID): | |
608 | + return munchify({ | |
617 | 609 | "data": { |
618 | 610 | "status": "active", |
619 | - "id": cancellation_id | |
611 | + "id": ID | |
620 | 612 | } |
621 | - } | |
622 | - return data | |
623 | - | |
624 | - | |
625 | -def test_confirm_contract_data(contract_id): | |
626 | - data = { | |
627 | - "data": { | |
628 | - "id": contract_id, | |
629 | - "status": "active" | |
630 | - } | |
631 | - } | |
632 | - return data | |
613 | + }) | |
633 | 614 | |
634 | 615 | |
635 | 616 | def test_submit_claim_data(claim_id): |
636 | - return { | |
617 | + return munchify({ | |
637 | 618 | "data": { |
638 | 619 | "id": claim_id, |
639 | 620 | "status": "claim" |
640 | 621 | } |
641 | - } | |
622 | + }) | |
642 | 623 | |
643 | 624 | |
644 | 625 | def test_additional_items_data(tender_id, access_token): |
645 | - data = {"access": {"token": access_token}, "data": {"id": tender_id, "items": [{"unit": {"code": "MON", "name": "month"}, "quantity": 9}]}} | |
646 | - return data | |
626 | + return munchify({ | |
627 | + "access": { | |
628 | + "token": access_token | |
629 | + }, | |
630 | + "data": { | |
631 | + "id": tender_id, | |
632 | + "items": [{ | |
633 | + "unit": { | |
634 | + "code": "MON", | |
635 | + "name": "month" | |
636 | + }, | |
637 | + "quantity": 9 | |
638 | + }] | |
639 | + } | |
640 | + }) | |
647 | 641 | |
648 | 642 | |
649 | 643 | def test_complaint_reply_data(): |
... | ... | @@ -786,7 +780,7 @@ def auction_bid(): |
786 | 780 | |
787 | 781 | |
788 | 782 | def test_supplier_data(): |
789 | - return { | |
783 | + return munchify({ | |
790 | 784 | "data": { |
791 | 785 | "suppliers": [ |
792 | 786 | { |
... | ... | @@ -817,7 +811,7 @@ def test_supplier_data(): |
817 | 811 | "valueAddedTaxIncluded": True |
818 | 812 | } |
819 | 813 | } |
820 | - } | |
814 | + }) | |
821 | 815 | |
822 | 816 | |
823 | 817 | def test_award_data(): | ... | ... |
... | ... | @@ -25,9 +25,7 @@ from .initial_data import ( |
25 | 25 | test_change_cancellation_document_field_data, |
26 | 26 | test_claim_answer_data, |
27 | 27 | test_claim_data, |
28 | - test_confirm_cancellation_data, | |
29 | - test_confirm_contract_data, | |
30 | - test_confirm_supplier_data, | |
28 | + test_confirm_data, | |
31 | 29 | test_claim_answer_satisfying_data, |
32 | 30 | test_complaint_answer_data, |
33 | 31 | test_complaint_data, | ... | ... |
Please
register
or
login
to post a comment