Commit 91e84357d424c901f039a2b25ac8a601cf4f24c7
1 parent
8a97cfda
Maintain PEP8 compliance
Also: Add 2 blank lines between all keywords in keywords.robot
Showing
3 changed files
with
14 additions
and
5 deletions
| @@ -431,7 +431,6 @@ def test_change_cancellation_document_field_data(key, value): | @@ -431,7 +431,6 @@ def test_change_cancellation_document_field_data(key, value): | ||
| 431 | }) | 431 | }) |
| 432 | 432 | ||
| 433 | 433 | ||
| 434 | - | ||
| 435 | def test_confirm_data(ID): | 434 | def test_confirm_data(ID): |
| 436 | return munchify({ | 435 | return munchify({ |
| 437 | "data": { | 436 | "data": { |
| @@ -454,14 +453,14 @@ def test_additional_items_data(tender_id, access_token): | @@ -454,14 +453,14 @@ def test_additional_items_data(tender_id, access_token): | ||
| 454 | return munchify({ | 453 | return munchify({ |
| 455 | "access": { | 454 | "access": { |
| 456 | "token": access_token | 455 | "token": access_token |
| 457 | - }, | 456 | + }, |
| 458 | "data": { | 457 | "data": { |
| 459 | "id": tender_id, | 458 | "id": tender_id, |
| 460 | - "items": [{ | 459 | + "items": [{ |
| 461 | "unit": { | 460 | "unit": { |
| 462 | "code": "MON", | 461 | "code": "MON", |
| 463 | "name": "month" | 462 | "name": "month" |
| 464 | - }, | 463 | + }, |
| 465 | "quantity": 9 | 464 | "quantity": 9 |
| 466 | }] | 465 | }] |
| 467 | } | 466 | } |
| @@ -740,6 +739,7 @@ def test_tender_data_openua(intervals): | @@ -740,6 +739,7 @@ def test_tender_data_openua(intervals): | ||
| 740 | 'accelerator={}'.format(accelerator) | 739 | 'accelerator={}'.format(accelerator) |
| 741 | return t_data | 740 | return t_data |
| 742 | 741 | ||
| 742 | + | ||
| 743 | def test_tender_data_openeu(intervals): | 743 | def test_tender_data_openeu(intervals): |
| 744 | accelerator = intervals['accelerator'] | 744 | accelerator = intervals['accelerator'] |
| 745 | # Since `accelerator` field is not really a list containing timings | 745 | # Since `accelerator` field is not really a list containing timings |
| @@ -10,6 +10,7 @@ Documentation | @@ -10,6 +10,7 @@ Documentation | ||
| 10 | ... This resource file contains keywords that are used directly by | 10 | ... This resource file contains keywords that are used directly by |
| 11 | ... test suites or by brokers' keyword libraries (also known as drivers). | 11 | ... test suites or by brokers' keyword libraries (also known as drivers). |
| 12 | 12 | ||
| 13 | + | ||
| 13 | *** Keywords *** | 14 | *** Keywords *** |
| 14 | Test Suite Setup | 15 | Test Suite Setup |
| 15 | Set Suite Variable ${WARN_RUN_AS} ${False} | 16 | Set Suite Variable ${WARN_RUN_AS} ${False} |
| @@ -17,10 +18,12 @@ Test Suite Setup | @@ -17,10 +18,12 @@ Test Suite Setup | ||
| 17 | Set Selenium Timeout 10 s | 18 | Set Selenium Timeout 10 s |
| 18 | Завантажуємо дані про користувачів і майданчики | 19 | Завантажуємо дані про користувачів і майданчики |
| 19 | 20 | ||
| 21 | + | ||
| 20 | Test Suite Teardown | 22 | Test Suite Teardown |
| 21 | Close all browsers | 23 | Close all browsers |
| 22 | Run Keyword And Ignore Error Створити артефакт | 24 | Run Keyword And Ignore Error Створити артефакт |
| 23 | 25 | ||
| 26 | + | ||
| 24 | Set Suite Variable With Default Value | 27 | Set Suite Variable With Default Value |
| 25 | [Arguments] ${suite_var} ${def_value} | 28 | [Arguments] ${suite_var} ${def_value} |
| 26 | ${tmp}= Get Variable Value ${${suite_var}} ${def_value} | 29 | ${tmp}= Get Variable Value ${${suite_var}} ${def_value} |
| @@ -82,6 +85,7 @@ Get Broker Property By Username | @@ -82,6 +85,7 @@ Get Broker Property By Username | ||
| 82 | ${broker_name}= Get Variable Value ${USERS.users['${username}'].broker} | 85 | ${broker_name}= Get Variable Value ${USERS.users['${username}'].broker} |
| 83 | Run Keyword And Return Get Broker Property ${broker_name} ${property} | 86 | Run Keyword And Return Get Broker Property ${broker_name} ${property} |
| 84 | 87 | ||
| 88 | + | ||
| 85 | Створити артефакт | 89 | Створити артефакт |
| 86 | ${artifact}= Create Dictionary | 90 | ${artifact}= Create Dictionary |
| 87 | ... api_version=${api_version} | 91 | ... api_version=${api_version} |
| @@ -96,6 +100,7 @@ Get Broker Property By Username | @@ -96,6 +100,7 @@ Get Broker Property By Username | ||
| 96 | Log ${artifact} | 100 | Log ${artifact} |
| 97 | log_object_data ${artifact} artifact update=${True} | 101 | log_object_data ${artifact} artifact update=${True} |
| 98 | 102 | ||
| 103 | + | ||
| 99 | Завантажити дані про тендер | 104 | Завантажити дані про тендер |
| 100 | ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml | 105 | ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml |
| 101 | ${ARTIFACT}= load_initial_data_from ${file_path} | 106 | ${ARTIFACT}= load_initial_data_from ${file_path} |
| @@ -165,6 +170,7 @@ Get Broker Property By Username | @@ -165,6 +170,7 @@ Get Broker Property By Username | ||
| 165 | Set To Dictionary ${USERS.users['${username}']} cancellation_data ${cancellation_data} | 170 | Set To Dictionary ${USERS.users['${username}']} cancellation_data ${cancellation_data} |
| 166 | [Return] ${cancellation_data} | 171 | [Return] ${cancellation_data} |
| 167 | 172 | ||
| 173 | + | ||
| 168 | Завантажуємо бібліотеку з реалізацією для майданчика ${keywords_file} | 174 | Завантажуємо бібліотеку з реалізацією для майданчика ${keywords_file} |
| 169 | ${bundled_st}= Run Keyword And Return Status Import Resource ${CURDIR}${/}brokers${/}${keywords_file}.robot | 175 | ${bundled_st}= Run Keyword And Return Status Import Resource ${CURDIR}${/}brokers${/}${keywords_file}.robot |
| 170 | ${external_st}= Run Keyword And Return Status Import Resource ${CURDIR}${/}..${/}..${/}src${/}robot_tests.broker.${keywords_file}${/}${keywords_file}.robot | 176 | ${external_st}= Run Keyword And Return Status Import Resource ${CURDIR}${/}..${/}..${/}src${/}robot_tests.broker.${keywords_file}${/}${keywords_file}.robot |
| @@ -387,6 +393,7 @@ Require Failure | @@ -387,6 +393,7 @@ Require Failure | ||
| 387 | Log ${username} | 393 | Log ${username} |
| 388 | Дочекатись дати ${USERS.users['${username}'].tender_data.data.auctionPeriod.endDate} | 394 | Дочекатись дати ${USERS.users['${username}'].tender_data.data.auctionPeriod.endDate} |
| 389 | 395 | ||
| 396 | + | ||
| 390 | Дочекатись дати закінчення періоду подання скарг | 397 | Дочекатись дати закінчення періоду подання скарг |
| 391 | [Arguments] ${username} | 398 | [Arguments] ${username} |
| 392 | log ${username} | 399 | log ${username} |
| @@ -117,7 +117,7 @@ def log_object_data(data, file_name=None, format="yaml", update=False): | @@ -117,7 +117,7 @@ def log_object_data(data, file_name=None, format="yaml", update=False): | ||
| 117 | file_obj.truncate() | 117 | file_obj.truncate() |
| 118 | except IOError as e: | 118 | except IOError as e: |
| 119 | LOGGER.log_message(Message(e, "INFO")) | 119 | LOGGER.log_message(Message(e, "INFO")) |
| 120 | - LOGGER.log_message(Message("Nothing to update, "\ | 120 | + LOGGER.log_message(Message("Nothing to update, " |
| 121 | "creating new file.", "INFO")) | 121 | "creating new file.", "INFO")) |
| 122 | data_obj = munch_to_object(data, format) | 122 | data_obj = munch_to_object(data, format) |
| 123 | with open(file_path, "w") as file_obj: | 123 | with open(file_path, "w") as file_obj: |
| @@ -125,12 +125,14 @@ def log_object_data(data, file_name=None, format="yaml", update=False): | @@ -125,12 +125,14 @@ def log_object_data(data, file_name=None, format="yaml", update=False): | ||
| 125 | data_obj = munch_to_object(data, format) | 125 | data_obj = munch_to_object(data, format) |
| 126 | LOGGER.log_message(Message(data_obj.decode('utf-8'), "INFO")) | 126 | LOGGER.log_message(Message(data_obj.decode('utf-8'), "INFO")) |
| 127 | 127 | ||
| 128 | + | ||
| 128 | def munch_from_object(data, format="yaml"): | 129 | def munch_from_object(data, format="yaml"): |
| 129 | if format.lower() == 'json': | 130 | if format.lower() == 'json': |
| 130 | return Munch.fromJSON(data) | 131 | return Munch.fromJSON(data) |
| 131 | else: | 132 | else: |
| 132 | return Munch.fromYAML(data) | 133 | return Munch.fromYAML(data) |
| 133 | 134 | ||
| 135 | + | ||
| 134 | def munch_to_object(data, format="yaml"): | 136 | def munch_to_object(data, format="yaml"): |
| 135 | if format.lower() == 'json': | 137 | if format.lower() == 'json': |
| 136 | return data.toJSON(indent=2) | 138 | return data.toJSON(indent=2) |
Please
register
or
login
to post a comment