Commit f401af8d0787c0bc79d8365aa178e479a617f579

Authored by Playtenders
2 parents bfa70cf2 f39d4fa2

Merge branch 'v3-dev' of https://git.4k.com.ua/root/playtender-robot_tests into v3-dev

Showing 1 changed file with 16 additions and 7 deletions
1 # -*- coding: utf-8 - 1 # -*- coding: utf-8 -
2 import re 2 import re
3 -import dateutil.parser  
4 3
  4 +import dateutil.parser
5 from iso8601 import parse_date 5 from iso8601 import parse_date
6 from robot.libraries.BuiltIn import BuiltIn 6 from robot.libraries.BuiltIn import BuiltIn
7 7
@@ -130,12 +130,15 @@ def trigger_input_change_event(locator): @@ -130,12 +130,15 @@ def trigger_input_change_event(locator):
130 def convert_float_to_string(number): 130 def convert_float_to_string(number):
131 return repr(float(number)) 131 return repr(float(number))
132 132
  133 +
133 def convert_esco__float_to_string(number): 134 def convert_esco__float_to_string(number):
134 return '{0:.5f}'.format(float(number)) 135 return '{0:.5f}'.format(float(number))
135 136
  137 +
136 def convert_float_to_string_3f(number): 138 def convert_float_to_string_3f(number):
137 return '{0:.3f}'.format(float(number)) 139 return '{0:.3f}'.format(float(number))
138 140
  141 +
139 # convert any variable to specified type 142 # convert any variable to specified type
140 def convert_to_specified_type(value, type): 143 def convert_to_specified_type(value, type):
141 value = "%s" % (value) 144 value = "%s" % (value)
@@ -242,6 +245,7 @@ def prepare_tender_data(data): @@ -242,6 +245,7 @@ def prepare_tender_data(data):
242 lot['features'].append(data['features'].pop(i)) 245 lot['features'].append(data['features'].pop(i))
243 l = l - 1 246 l = l - 1
244 i = i - 1 247 i = i - 1
  248 + break
245 if data['features'][i]['featureOf'] == 'item': 249 if data['features'][i]['featureOf'] == 'item':
246 for item in data['items']: 250 for item in data['items']:
247 if item['id'] == data['features'][i]['relatedItem']: 251 if item['id'] == data['features'][i]['relatedItem']:
@@ -250,6 +254,7 @@ def prepare_tender_data(data): @@ -250,6 +254,7 @@ def prepare_tender_data(data):
250 item['features'].append(data['features'].pop(i)) 254 item['features'].append(data['features'].pop(i))
251 l = l - 1 255 l = l - 1
252 i = i - 1 256 i = i - 1
  257 + break
253 i = i + 1 258 i = i + 1
254 259
255 if 'features' in data: 260 if 'features' in data:
@@ -267,6 +272,7 @@ def prepare_tender_data(data): @@ -267,6 +272,7 @@ def prepare_tender_data(data):
267 lot['items'].append(data['items'].pop(i)) 272 lot['items'].append(data['items'].pop(i))
268 l = l - 1 273 l = l - 1
269 i = i - 1 274 i = i - 1
  275 + break
270 i = i + 1 276 i = i + 1
271 277
272 del data['items'] 278 del data['items']
@@ -284,24 +290,27 @@ def prepare_tender_data(data): @@ -284,24 +290,27 @@ def prepare_tender_data(data):
284 lot['milestones'].append(data['milestones'].pop(i)) 290 lot['milestones'].append(data['milestones'].pop(i))
285 l = l - 1 291 l = l - 1
286 i = i - 1 292 i = i - 1
  293 + break
287 i = i + 1 294 i = i + 1
288 295
289 del data['milestones'] 296 del data['milestones']
290 297
291 return data 298 return data
292 299
  300 +
293 def split_agreementDuration(str, type): 301 def split_agreementDuration(str, type):
294 if type in 'year': 302 if type in 'year':
295 - year_temp = str.split('Y',1)  
296 - value = year_temp[0].split('P',1) 303 + year_temp = str.split('Y', 1)
  304 + value = year_temp[0].split('P', 1)
297 elif type in 'month': 305 elif type in 'month':
298 - month_temp = str.split('M',1)  
299 - value = month_temp[0].split('Y',1) 306 + month_temp = str.split('M', 1)
  307 + value = month_temp[0].split('Y', 1)
300 else: 308 else:
301 - day_temp = str.split('D',1)  
302 - value = day_temp[0].split('M',1) 309 + day_temp = str.split('D', 1)
  310 + value = day_temp[0].split('M', 1)
303 return value[1] 311 return value[1]
304 312
  313 +
305 def convert_date_to_string_contr(date): 314 def convert_date_to_string_contr(date):
306 date = dateutil.parser.parse(date) 315 date = dateutil.parser.parse(date)
307 date = date.strftime("%d.%m.%Y %H:%M:%S") 316 date = date.strftime("%d.%m.%Y %H:%M:%S")
Please register or login to post a comment