Commit fd52c58cc7986bce70b6f5385a705c5660fc1515

Authored by Leits
1 parent 64833108

Move artifact from test_output to op_robot_tests/tests_files/data folder

@@ -176,7 +176,7 @@ Get Broker Property By Username @@ -176,7 +176,7 @@ Get Broker Property By Username
176 Run Keyword If '${status}'=='PASS' 176 Run Keyword If '${status}'=='PASS'
177 ... Set To Dictionary ${artifact} lots=${lots_ids} 177 ... Set To Dictionary ${artifact} lots=${lots_ids}
178 Log ${artifact} 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,7 +193,7 @@ Get Broker Property By Username
193 Set Suite Variable ${mode} 193 Set Suite Variable ${mode}
194 Set Suite Variable ${lot_index} 194 Set Suite Variable ${lot_index}
195 Set Suite Variable ${TENDER} 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,7 +143,7 @@ def compare_coordinates(left_lat, left_lon, right_lat, right_lon, accuracy=0.1):
143 return True 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 """Log object data in pretty format (JSON or YAML) 147 """Log object data in pretty format (JSON or YAML)
148 148
149 Two output formats are supported: "yaml" and "json". 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,8 +164,11 @@ def log_object_data(data, file_name=None, format="yaml", update=False):
164 if not isinstance(data, Munch): 164 if not isinstance(data, Munch):
165 data = munchify(data) 165 data = munchify(data)
166 if file_name: 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 if update: 172 if update:
170 try: 173 try:
171 with open(file_path, "r+") as file_obj: 174 with open(file_path, "r+") as file_obj:
Please register or login to post a comment