Commit fd52c58cc7986bce70b6f5385a705c5660fc1515
1 parent
64833108
Move artifact from test_output to op_robot_tests/tests_files/data folder
Showing
2 changed files
with
8 additions
and
5 deletions
| ... | ... | @@ -176,7 +176,7 @@ Get Broker Property By Username |
| 176 | 176 | Run Keyword If '${status}'=='PASS' |
| 177 | 177 | ... Set To Dictionary ${artifact} lots=${lots_ids} |
| 178 | 178 | Log ${artifact} |
| 179 | - log_object_data ${artifact} artifact update=${True} | |
| 179 | + log_object_data ${artifact} file_name=artifact update=${True} artifact=${True} | |
| 180 | 180 | |
| 181 | 181 | |
| 182 | 182 | Завантажити дані про тендер |
| ... | ... | @@ -193,7 +193,7 @@ Get Broker Property By Username |
| 193 | 193 | Set Suite Variable ${mode} |
| 194 | 194 | Set Suite Variable ${lot_index} |
| 195 | 195 | Set Suite Variable ${TENDER} |
| 196 | - log_object_data ${ARTIFACT} artifact | |
| 196 | + log_object_data ${ARTIFACT} file_name=artifact update=${True} artifact=${True} | |
| 197 | 197 | |
| 198 | 198 | |
| 199 | 199 | Підготувати дані для створення тендера | ... | ... |
| ... | ... | @@ -143,7 +143,7 @@ def compare_coordinates(left_lat, left_lon, right_lat, right_lon, accuracy=0.1): |
| 143 | 143 | return True |
| 144 | 144 | |
| 145 | 145 | |
| 146 | -def log_object_data(data, file_name=None, format="yaml", update=False): | |
| 146 | +def log_object_data(data, file_name=None, format="yaml", update=False, artifact=False): | |
| 147 | 147 | """Log object data in pretty format (JSON or YAML) |
| 148 | 148 | |
| 149 | 149 | Two output formats are supported: "yaml" and "json". |
| ... | ... | @@ -164,8 +164,11 @@ def log_object_data(data, file_name=None, format="yaml", update=False): |
| 164 | 164 | if not isinstance(data, Munch): |
| 165 | 165 | data = munchify(data) |
| 166 | 166 | if file_name: |
| 167 | - output_dir = BuiltIn().get_variable_value("${OUTPUT_DIR}") | |
| 168 | - file_path = os.path.join(output_dir, file_name + '.' + format) | |
| 167 | + if artifact: | |
| 168 | + file_path = os.path.join(os.path.dirname(__file__), 'data', file_name + '.' + format) | |
| 169 | + else: | |
| 170 | + output_dir = BuiltIn().get_variable_value("${OUTPUT_DIR}") | |
| 171 | + file_path = os.path.join(output_dir, file_name + '.' + format) | |
| 169 | 172 | if update: |
| 170 | 173 | try: |
| 171 | 174 | with open(file_path, "r+") as file_obj: | ... | ... |
Please
register
or
login
to post a comment