Commit 4ea21abd606454a22d3bdb9f0a600e9e9264d98a
Merge pull request #108 from Leits/cache
Work with cache on keywords level
Showing
2 changed files
with
21 additions
and
13 deletions
... | ... | @@ -65,14 +65,6 @@ Library openprocurement_client_helper.py |
65 | 65 | Log ${username} |
66 | 66 | Log ${field_name} |
67 | 67 | |
68 | - ${status} ${field_value}= Run keyword and ignore error | |
69 | - ... Get from object | |
70 | - ... ${USERS.users['${username}'].tender_data.data} | |
71 | - ... ${field_name} | |
72 | - # If field is found, return its value | |
73 | - Run Keyword if '${status}' == 'PASS' Return from keyword ${field_value} | |
74 | - | |
75 | - # Else refresh cached data and try again | |
76 | 68 | openprocurement_client.Пошук тендера по ідентифікатору |
77 | 69 | ... ${username} |
78 | 70 | ... ${TENDER['TENDER_UAID']} |
... | ... | @@ -83,7 +75,6 @@ Library openprocurement_client_helper.py |
83 | 75 | ... ${field_name} |
84 | 76 | Run Keyword if '${status}' == 'PASS' Return from keyword ${field_value} |
85 | 77 | |
86 | - # If field is still absent, trigger a failure | |
87 | 78 | Fail Field not found: ${field_name} |
88 | 79 | |
89 | 80 | ... | ... |
... | ... | @@ -277,11 +277,10 @@ Get Broker Property By Username |
277 | 277 | |
278 | 278 | Звірити поле тендера із значенням |
279 | 279 | [Arguments] ${username} ${left} ${field} |
280 | - ${right}= Викликати для учасника ${username} Отримати інформацію із тендера ${field} | |
280 | + ${right}= Отримати дані із тендера ${username} ${field} | |
281 | 281 | Log ${left} |
282 | 282 | Log ${right} |
283 | 283 | Порівняти об'єкти ${left} ${right} |
284 | - Set_To_Object ${USERS.users['${username}'].tender_data.data} ${field} ${left} | |
285 | 284 | |
286 | 285 | |
287 | 286 | Порівняти об'єкти |
... | ... | @@ -301,9 +300,8 @@ Get Broker Property By Username |
301 | 300 | |
302 | 301 | Звірити дату тендера із значенням |
303 | 302 | [Arguments] ${username} ${left} ${field} |
304 | - ${right}= Викликати для учасника ${username} Отримати інформацію із тендера ${field} | |
303 | + ${right}= Отримати дані із тендера ${username} ${field} | |
305 | 304 | Порівняти дати ${left} ${right} |
306 | - Set_To_Object ${USERS.users['${username}'].tender_data.data} ${field} ${left} | |
307 | 305 | |
308 | 306 | |
309 | 307 | Порівняти дати |
... | ... | @@ -354,6 +352,25 @@ Get Broker Property By Username |
354 | 352 | ... WARN |
355 | 353 | Run Keyword And Return Run As ${username} ${command} @{arguments} |
356 | 354 | |
355 | +Отримати дані із тендера | |
356 | + [Arguments] ${username} ${field_name} | |
357 | + Log ${username} | |
358 | + Log ${field_name} | |
359 | + | |
360 | + ${status} ${field_value}= Run keyword and ignore error | |
361 | + ... Get from object | |
362 | + ... ${USERS.users['${username}'].tender_data.data} | |
363 | + ... ${field_name} | |
364 | + # If field in cache, return its value | |
365 | + Run Keyword if '${status}' == 'PASS' Return from keyword ${field_value} | |
366 | + # Else call broker to find field | |
367 | + ${field_value}= Викликати для учасника ${username} Отримати інформацію із тендера ${field_name} | |
368 | + # And caching its value before return | |
369 | + Set_To_Object ${USERS.users['${username}'].tender_data.data} ${field_name} ${field_value} | |
370 | + [return] ${field_value} | |
371 | + | |
372 | + | |
373 | + | |
357 | 374 | |
358 | 375 | Run As |
359 | 376 | [Arguments] ${username} ${command} @{arguments} | ... | ... |
Please
register
or
login
to post a comment