Commit 872bfee148efbe42de50d7344df9d88e499a7525
Committed by
GitHub
Merge pull request #577 from ivanka12/devel
compare file properties
Showing
6 changed files
with
82 additions
and
0 deletions
| @@ -164,6 +164,25 @@ Resource resource.robot | @@ -164,6 +164,25 @@ Resource resource.robot | ||
| 164 | Порівняти об'єкти ${left} ${right} | 164 | Порівняти об'єкти ${left} ${right} |
| 165 | 165 | ||
| 166 | 166 | ||
| 167 | +Отримати інформацію про документ тендера ${doc_id} ${username} | ||
| 168 | + ${file_properties} = Run as ${username} Отримати інформацію про документ ${TENDER['TENDER_UAID']} ${doc_id} | ||
| 169 | + Set To Dictionary ${USERS.users['${tender_owner}'].tender_document} file_properties=${file_properties} | ||
| 170 | + Log ${file_properties} | ||
| 171 | + | ||
| 172 | + | ||
| 173 | +Отримати інформацію про документ лотів ${doc_id} ${username} | ||
| 174 | + ${file_properties} = Run as ${username} Отримати інформацію про документ ${TENDER['TENDER_UAID']} ${doc_id} | ||
| 175 | + Set To Dictionary ${USERS.users['${tender_owner}'].lots_documents[0]} file_properties=${file_properties} | ||
| 176 | + Log ${file_properties} | ||
| 177 | + | ||
| 178 | + | ||
| 179 | +Звірити інформацію про документацію ${file_properties} ${username} | ||
| 180 | + ${file_contents}= Run as ${username} Отримати вміст документа ${file_properties.url} | ||
| 181 | + ${file_hash}= get_hash ${file_contents} | ||
| 182 | + ${new_file_properties}= Call Method ${USERS.users['${viewer}'].client} get_file_properties ${file_properties.url} ${file_hash} | ||
| 183 | + Порівняти об'єкти ${new_file_properties} ${file_properties} | ||
| 184 | + | ||
| 185 | + | ||
| 167 | Звірити відображення дати ${date} тендера для усіх користувачів | 186 | Звірити відображення дати ${date} тендера для усіх користувачів |
| 168 | :FOR ${username} IN ${viewer} ${tender_owner} ${provider} ${provider1} | 187 | :FOR ${username} IN ${viewer} ${tender_owner} ${provider} ${provider1} |
| 169 | \ Звірити відображення дати ${date} тендера для користувача ${username} | 188 | \ Звірити відображення дати ${date} тендера для користувача ${username} |
| @@ -86,6 +86,15 @@ Library openprocurement_client.utils | @@ -86,6 +86,15 @@ Library openprocurement_client.utils | ||
| 86 | [Return] ${document['${field}']} | 86 | [Return] ${document['${field}']} |
| 87 | 87 | ||
| 88 | 88 | ||
| 89 | +Отримати інформацію про документ | ||
| 90 | + [Arguments] ${username} ${tender_uaid} ${doc_id} | ||
| 91 | + ${tender}= openprocurement_client.Пошук тендера по ідентифікатору ${username} ${tender_uaid} | ||
| 92 | + ${document}= get_document_by_id ${tender.data} ${doc_id} | ||
| 93 | + ${file_properties}= Call Method ${USERS.users['${username}'].client} get_file_properties ${document.url} ${document.hash} | ||
| 94 | + Log ${file_properties} | ||
| 95 | + [return] ${file_properties} | ||
| 96 | + | ||
| 97 | + | ||
| 89 | Отримати документ | 98 | Отримати документ |
| 90 | [Arguments] ${username} ${tender_uaid} ${doc_id} | 99 | [Arguments] ${username} ${tender_uaid} ${doc_id} |
| 91 | ${tender}= openprocurement_client.Пошук тендера по ідентифікатору ${username} ${tender_uaid} | 100 | ${tender}= openprocurement_client.Пошук тендера по ідентифікатору ${username} ${tender_uaid} |
| @@ -94,6 +103,13 @@ Library openprocurement_client.utils | @@ -94,6 +103,13 @@ Library openprocurement_client.utils | ||
| 94 | [return] ${filename} | 103 | [return] ${filename} |
| 95 | 104 | ||
| 96 | 105 | ||
| 106 | +Отримати вміст документа | ||
| 107 | + [Arguments] ${username} ${url} | ||
| 108 | + ${file_name}= download_file_from_url ${url} ${OUTPUT_DIR}${/}file | ||
| 109 | + ${file_contents}= Get File ${OUTPUT_DIR}${/}${file_name} | ||
| 110 | + [return] ${file_contents} | ||
| 111 | + | ||
| 112 | + | ||
| 97 | Отримати посилання на аукціон для глядача | 113 | Отримати посилання на аукціон для глядача |
| 98 | [Arguments] ${username} ${tender_uaid} ${lot_id}=${Empty} | 114 | [Arguments] ${username} ${tender_uaid} ${lot_id}=${Empty} |
| 99 | ${tender}= openprocurement_client.Пошук тендера по ідентифікатору ${username} ${tender_uaid} | 115 | ${tender}= openprocurement_client.Пошук тендера по ідентифікатору ${username} ${tender_uaid} |
| 1 | # -*- coding: utf-8 - | 1 | # -*- coding: utf-8 - |
| 2 | import os | 2 | import os |
| 3 | import random | 3 | import random |
| 4 | +import hashlib | ||
| 4 | from datetime import timedelta | 5 | from datetime import timedelta |
| 5 | from tempfile import NamedTemporaryFile | 6 | from tempfile import NamedTemporaryFile |
| 6 | from uuid import uuid4 | 7 | from uuid import uuid4 |
| @@ -552,3 +553,7 @@ def test_change_data(): | @@ -552,3 +553,7 @@ def test_change_data(): | ||
| 552 | "status": "pending" | 553 | "status": "pending" |
| 553 | } | 554 | } |
| 554 | }) | 555 | }) |
| 556 | + | ||
| 557 | + | ||
| 558 | +def get_hash(file_contents): | ||
| 559 | + return ("md5:"+hashlib.md5(file_contents).hexdigest()) |
| @@ -176,6 +176,9 @@ Get Broker Property By Username | @@ -176,6 +176,9 @@ Get Broker Property By Username | ||
| 176 | Run Keyword And Ignore Error Set To Dictionary ${artifact} provider1_access_token=${USERS.users['${provider1}'].access_token} | 176 | Run Keyword And Ignore Error Set To Dictionary ${artifact} provider1_access_token=${USERS.users['${provider1}'].access_token} |
| 177 | Run Keyword And Ignore Error Set To Dictionary ${artifact} provider_bid_id=${USERS.users['${provider}'].bid_id} | 177 | Run Keyword And Ignore Error Set To Dictionary ${artifact} provider_bid_id=${USERS.users['${provider}'].bid_id} |
| 178 | Run Keyword And Ignore Error Set To Dictionary ${artifact} provider1_bid_id=${USERS.users['${provider1}'].bid_id} | 178 | Run Keyword And Ignore Error Set To Dictionary ${artifact} provider1_bid_id=${USERS.users['${provider1}'].bid_id} |
| 179 | + Run Keyword And Ignore Error Set To Dictionary ${artifact} | ||
| 180 | + ... tender_file_properties=${USERS.users['${tender_owner}'].tender_document.file_properties} | ||
| 181 | + ... lot_file_properties=${USERS.users['${tender_owner}'].lots_documents[0].file_properties} | ||
| 179 | ${status} ${lots_ids}= Run Keyword And Ignore Error Отримати ідентифікатори об’єктів ${viewer} lots | 182 | ${status} ${lots_ids}= Run Keyword And Ignore Error Отримати ідентифікатори об’єктів ${viewer} lots |
| 180 | Run Keyword If '${status}'=='PASS' | 183 | Run Keyword If '${status}'=='PASS' |
| 181 | ... Set To Dictionary ${artifact} lots=${lots_ids} | 184 | ... Set To Dictionary ${artifact} lots=${lots_ids} |
| @@ -195,6 +198,8 @@ Get Broker Property By Username | @@ -195,6 +198,8 @@ Get Broker Property By Username | ||
| 195 | Run Keyword And Ignore Error Set To Dictionary ${TENDER} LOT_ID=${ARTIFACT.lots[${lot_index}]} | 198 | Run Keyword And Ignore Error Set To Dictionary ${TENDER} LOT_ID=${ARTIFACT.lots[${lot_index}]} |
| 196 | ${MODE}= Get Variable Value ${MODE} ${ARTIFACT.mode} | 199 | ${MODE}= Get Variable Value ${MODE} ${ARTIFACT.mode} |
| 197 | Run Keyword And Ignore Error Set To Dictionary ${USERS.users['${tender_owner}']} access_token=${ARTIFACT.tender_owner_access_token} | 200 | Run Keyword And Ignore Error Set To Dictionary ${USERS.users['${tender_owner}']} access_token=${ARTIFACT.tender_owner_access_token} |
| 201 | + Run Keyword And Ignore Error Set To Dictionary ${USERS.users['${viewer}']} tender_file_properties=${ARTIFACT.tender_file_properties} | ||
| 202 | + Run Keyword And Ignore Error Set To Dictionary ${USERS.users['${viewer}']} lot_file_properties=${ARTIFACT.lot_file_properties} | ||
| 198 | Run Keyword And Ignore Error Set To Dictionary ${USERS.users['${provider}']} access_token=${ARTIFACT.provider_access_token} | 203 | Run Keyword And Ignore Error Set To Dictionary ${USERS.users['${provider}']} access_token=${ARTIFACT.provider_access_token} |
| 199 | Run Keyword And Ignore Error Set To Dictionary ${USERS.users['${provider1}']} access_token=${ARTIFACT.provider1_access_token} | 204 | Run Keyword And Ignore Error Set To Dictionary ${USERS.users['${provider1}']} access_token=${ARTIFACT.provider1_access_token} |
| 200 | Run Keyword And Ignore Error Set To Dictionary ${USERS.users['${provider}']} bid_id=${ARTIFACT.provider_bid_id} | 205 | Run Keyword And Ignore Error Set To Dictionary ${USERS.users['${provider}']} bid_id=${ARTIFACT.provider_bid_id} |
| @@ -476,6 +476,42 @@ ${ITEM_MEAT} ${True} | @@ -476,6 +476,42 @@ ${ITEM_MEAT} ${True} | ||
| 476 | Звірити відображення поля title документа ${USERS.users['${tender_owner}']['tender_document']['doc_id']} із ${USERS.users['${tender_owner}'].tender_document.doc_name} для користувача ${viewer} | 476 | Звірити відображення поля title документа ${USERS.users['${tender_owner}']['tender_document']['doc_id']} із ${USERS.users['${tender_owner}'].tender_document.doc_name} для користувача ${viewer} |
| 477 | 477 | ||
| 478 | 478 | ||
| 479 | +Можливість отримати інформацію про документацію до тендера | ||
| 480 | + [Tags] ${USERS.users['${tender_owner}'].broker}: Відображення документації | ||
| 481 | + ... tender_owner | ||
| 482 | + ... ${USERS.users['${tender_owner}'].broker} | ||
| 483 | + ... get_file_properties | ||
| 484 | + [Setup] Дочекатись синхронізації з майданчиком ${tender_owner} | ||
| 485 | + Отримати інформацію про документ тендера ${USERS.users['${tender_owner}'].tender_document.doc_id} ${tender_owner} | ||
| 486 | + | ||
| 487 | + | ||
| 488 | +Можливість отримати інформацію про документацію до лотів | ||
| 489 | + [Tags] ${USERS.users['${tender_owner}'].broker}: Відображення документації | ||
| 490 | + ... tender_owner | ||
| 491 | + ... ${USERS.users['${tender_owner}'].broker} | ||
| 492 | + ... get_file_properties | ||
| 493 | + [Setup] Дочекатись синхронізації з майданчиком ${tender_owner} | ||
| 494 | + Отримати інформацію про документ лотів ${USERS.users['${tender_owner}'].lots_documents[0].doc_id} ${tender_owner} | ||
| 495 | + | ||
| 496 | + | ||
| 497 | +Можливість перевірити інформацію про документацію до тендера | ||
| 498 | + [Tags] ${USERS.users['${viewer}'].broker}: Відображення документації | ||
| 499 | + ... viewer | ||
| 500 | + ... ${USERS.users['${viewer}'].broker} | ||
| 501 | + ... compare_file_properties | ||
| 502 | + Завантажити дані про тендер | ||
| 503 | + Звірити інформацію про документацію ${USERS.users['${viewer}'].tender_file_properties} ${viewer} | ||
| 504 | + | ||
| 505 | + | ||
| 506 | +Можливість перевірити інформацію про документацію до лотів | ||
| 507 | + [Tags] ${USERS.users['${viewer}'].broker}: Відображення документації | ||
| 508 | + ... viewer | ||
| 509 | + ... ${USERS.users['${viewer}'].broker} | ||
| 510 | + ... compare_file_properties | ||
| 511 | + Завантажити дані про тендер | ||
| 512 | + Звірити інформацію про документацію ${USERS.users['${viewer}'].lot_file_properties} ${viewer} | ||
| 513 | + | ||
| 514 | + | ||
| 479 | Відображення заголовку документації до всіх лотів | 515 | Відображення заголовку документації до всіх лотів |
| 480 | [Tags] ${USERS.users['${viewer}'].broker}: Відображення документації | 516 | [Tags] ${USERS.users['${viewer}'].broker}: Відображення документації |
| 481 | ... viewer | 517 | ... viewer |
| @@ -54,6 +54,7 @@ from .initial_data import ( | @@ -54,6 +54,7 @@ from .initial_data import ( | ||
| 54 | test_change_document_data, | 54 | test_change_document_data, |
| 55 | convert_amount, | 55 | convert_amount, |
| 56 | get_number_of_minutes, | 56 | get_number_of_minutes, |
| 57 | + get_hash, | ||
| 57 | ) | 58 | ) |
| 58 | from barbecue import chef | 59 | from barbecue import chef |
| 59 | from restkit import request | 60 | from restkit import request |
Please
register
or
login
to post a comment