From c1e812cb9316b0568fb81b4a368f01366ea2ccd4 Mon Sep 17 00:00:00 2001
From: Leits <leits@quintagroup.org>
Date: Fri, 6 May 2016 11:52:08 +0300
Subject: [PATCH] Update code to work with lot ids

---
 op_robot_tests/tests_files/brokers/openprocurement_client.robot | 21 ++++++++++-----------
 op_robot_tests/tests_files/keywords.robot                       |  2 +-
 op_robot_tests/tests_files/qualification.robot                  | 10 +++++++---
 3 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/op_robot_tests/tests_files/brokers/openprocurement_client.robot b/op_robot_tests/tests_files/brokers/openprocurement_client.robot
index 24c03d0..05939bd 100644
--- a/op_robot_tests/tests_files/brokers/openprocurement_client.robot
+++ b/op_robot_tests/tests_files/brokers/openprocurement_client.robot
@@ -49,9 +49,9 @@ Library  openprocurement_client_helper.py
 
 
 Отримати посилання на аукціон для глядача
-  [Arguments]  ${username}  ${tender_uaid}  ${lot_id}=${None}
+  [Arguments]  ${username}  ${tender_uaid}  ${lot_id}=${Empty}
   ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
-  ${auctionUrl}=  Run Keyword IF  ${lot_id}  Set Variable  ${tender.data.lots[${lot_index}].auctionUrl}
+  ${auctionUrl}=  Run Keyword IF  '${lot_id}'  Set Variable  ${tender.data.lots[${lot_index}].auctionUrl}
   ...                         ELSE  Set Variable  ${tender.data.auctionUrl}
   [return]  ${auctionUrl}
 
@@ -129,7 +129,7 @@ Library  openprocurement_client_helper.py
 
 
 Видалити предмет закупівлі
-  [Arguments]  ${username}  ${tender_uaid}  ${item_id}  ${lot_id}=${None}
+  [Arguments]  ${username}  ${tender_uaid}  ${item_id}  ${lot_id}=${Empty}
   ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
   ${item_index}=  get_object_index_by_id  ${tender.data['items']}  ${item_id}
   Remove From List  ${tender.data['items']}  ${item_index}
@@ -435,9 +435,9 @@ Library  openprocurement_client_helper.py
 
 
 Отримати посилання на аукціон для учасника
-  [Arguments]  ${username}  ${tender_uaid}  ${lot_id}=${None}
+  [Arguments]  ${username}  ${tender_uaid}  ${lot_id}=${Empty}
   ${bid}=  openprocurement_client.Отримати пропозицію  ${username}  ${tender_uaid}
-  ${participationUrl}=  Run Keyword IF  ${lot_id}  Set Variable  ${bid.data.lotValues[${lot_index}].participationUrl}
+  ${participationUrl}=  Run Keyword IF  '${lot_id}'  Set Variable  ${bid.data.lotValues[${lot_index}].participationUrl}
   ...                         ELSE  Set Variable  ${bid.data.participationUrl}
   [return]  ${participationUrl}
 
@@ -450,14 +450,9 @@ Library  openprocurement_client_helper.py
   ...      [Arguments] Username, tender uaid, qualification number and document to upload
   ...      [Description] Find tender using uaid,  and call upload_qualification_document
   ...      [Return] Reply of API
-  [Arguments]  ${username}  ${document}  ${tender_uaid}  ${award_num}  ${lot_id}=${None}
+  [Arguments]  ${username}  ${document}  ${tender_uaid}  ${award_num}
   ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
   ${doc}=  Call Method  ${USERS.users['${username}'].client}  upload_award_document  ${document}  ${tender}  ${tender.data.awards[${award_num}].id}
-  ${lot_index}=  Run Keyword If  ${lot_id}  get_object_index_by_id  ${tender.data.lots}  ${lot_id}
-  Run Keyword If  ${lot_id}
-  ...      Set To Object  ${doc.data}  documentOf  lot
-  ...      Set To Object  ${doc.data}  relatedItem  ${tender.data.lots[${lot_index}].id}
-  ...      Call Method  ${USERS.users['${username}'].client}  patch_document   ${tender}   ${doc}
   Log  ${doc}
   [Return]  ${doc}
 
@@ -471,6 +466,10 @@ Library  openprocurement_client_helper.py
   ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
   ${award}=  create_data_dict  data.status  active
   Set To Dictionary  ${award.data}  id=${tender.data.awards[${award_num}].id}
+  Run Keyword IF  'open' in '${mode}'
+  ...      Set To Dictionary  ${award.data}
+  ...      qualified=${True}
+  ...      eligible=${True}
   ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_award  ${tender}  ${award}
   Log  ${reply}
 
diff --git a/op_robot_tests/tests_files/keywords.robot b/op_robot_tests/tests_files/keywords.robot
index a2799ce..05670a0 100644
--- a/op_robot_tests/tests_files/keywords.robot
+++ b/op_robot_tests/tests_files/keywords.robot
@@ -180,7 +180,7 @@ Get Broker Property By Username
   ${file_path}=  Get Variable Value  ${ARTIFACT_FILE}  artifact.yaml
   ${ARTIFACT}=  load_data_from  ${file_path}
   Run Keyword And Ignore Error  Set To Dictionary  ${USERS.users['${tender_owner}']}  access_token=${ARTIFACT.access_token}
-  ${TENDER}=  Create Dictionary   TENDER_UAID=${ARTIFACT.tender_uaid}   LAST_MODIFICATION_DATE=${ARTIFACT.last_modification_date}   LOT_ID=${None}
+  ${TENDER}=  Create Dictionary   TENDER_UAID=${ARTIFACT.tender_uaid}   LAST_MODIFICATION_DATE=${ARTIFACT.last_modification_date}   LOT_ID=${Empty}
   ${lot_index}=  Get Variable Value  ${lot_index}  0
   Run Keyword And Ignore Error  Set To Dictionary  ${TENDER}  LOT_ID=${ARTIFACT.lots[${lot_index}]}
   ${mode}=  Get Variable Value  ${mode}  ${ARTIFACT.mode}
diff --git a/op_robot_tests/tests_files/qualification.robot b/op_robot_tests/tests_files/qualification.robot
index 2f999fc..2cb8a1c 100644
--- a/op_robot_tests/tests_files/qualification.robot
+++ b/op_robot_tests/tests_files/qualification.robot
@@ -29,9 +29,10 @@ Suite Teardown  Test Suite Teardown
   ...      ${USERS.users['${tender_owner}'].broker}
   :FOR  ${username}  IN  ${viewer}  ${tender_owner}
   \   ${qualification_status}=  Отримати дані із тендера  ${tender_owner}  status  ${TENDER['LOT_ID']}
-  \   Run Keyword IF  ${TENDER['LOT_ID']}  Should Be Equal  ${qualification_status}  active
+  \   Run Keyword IF  '${TENDER['LOT_ID']}'  Should Be Equal  ${qualification_status}  active
   \   ...         ELSE  Should Be Equal  ${qualification_status}  active.qualification
 
+
 Відображення вартості номенклатури постачальника
   [Tags]   ${USERS.users['${tender_owner}'].broker}: Відображення основних даних оголошеного тендера
   ...      tender_owner
@@ -63,7 +64,8 @@ Suite Teardown  Test Suite Teardown
   ...  tender_owner
   ...  ${USERS.users['${tender_owner}'].broker}
   ${filepath}=   create_fake_doc
-  Викликати для учасника   ${tender_owner}   Завантажити документ рішення кваліфікаційної комісії   ${filepath}   ${TENDER['TENDER_UAID']}   0  ${TENDER['LOT_ID']}
+  Викликати для учасника   ${tender_owner}   Завантажити документ рішення кваліфікаційної комісії   ${filepath}   ${TENDER['TENDER_UAID']}   0
+
 
 Можливість підтвердити постачальника
   [Tags]  ${USERS.users['${tender_owner}'].broker}: Можливість зареєструвати і підтвердити постачальника до прямої закупівлі
@@ -78,12 +80,14 @@ Suite Teardown  Test Suite Teardown
   ...  minimal
   Викликати для учасника  ${tender_owner}  Скасування рішення кваліфікаційної комісії  ${TENDER['TENDER_UAID']}  0
 
+
 Можливість завантажити документ рішення кваліфікаційної комісії для підтвердження нового постачальника
   [Tags]  ${USERS.users['${tender_owner}'].broker}: Можливість укласти угоду для прямої закупівлі
   ...  tender_owner
   ...  ${USERS.users['${tender_owner}'].broker}
   ${filepath}=   create_fake_doc
-  Викликати для учасника   ${tender_owner}   Завантажити документ рішення кваліфікаційної комісії   ${filepath}   ${TENDER['TENDER_UAID']}   1   ${TENDER['LOT_ID']}
+  Викликати для учасника   ${tender_owner}   Завантажити документ рішення кваліфікаційної комісії   ${filepath}   ${TENDER['TENDER_UAID']}   1
+
 
 Можливість підтвердити нового постачальника
   [Tags]  ${USERS.users['${tender_owner}'].broker}: Можливість зареєструвати і підтвердити постачальника до прямої закупівлі
--
libgit2 0.24.0