Changeset 29140 for branches/sc_branches/psps_testing/psi/psi_inquisitor.py
- Timestamp:
- Sep 10, 2010, 9:39:28 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sc_branches/psps_testing/psi/psi_inquisitor.py
r29115 r29140 2 2 from suds.xsd.doctor import Import, ImportDoctor 3 3 from suds import sudsobject 4 from utilities.util import convert 5 import unicodedata 4 6 5 7 class PsiInquisitor: … … 42 44 >>> # we cannot guarantee the order in result 43 45 >>> print result['items'] 44 [{ u'[frameID]': u'105439'}]46 [{'frameID': 105439}] 45 47 >>> print result['fields'] 46 [ u'[frameID]']48 ['[frameID]'] 47 49 >>> print result['types'] 48 { u'[frameID]': u'Integer'}50 {'[frameID]': 'Integer'} 49 51 >>> # This test has to be completed with exhaustive ones... 50 52 >>> # e.g. unit tests against the csr data base. … … 62 64 line_count = 0 63 65 for line in lines: 66 # Unicode normalization comes from 67 # http://www.peterbe.com/plog/unicode-to-ascii. I don't 68 # know where the NFKD means... 69 line = unicodedata.normalize('NFKD', line).encode('ascii','ignore') 64 70 if first_line_not_seen: 65 71 # Build up the field list and the types dictionary … … 85 91 element = {} 86 92 for i in range(len(values)): 87 element[contents['fields'][i]] = values[i] 93 field_name = contents['fields'][i].replace('[', 94 '').replace(']', 95 '') 96 element[field_name] = convert(types_dictionary[contents['fields'][i]], 97 values[i]) 88 98 contents['items'].append(element) 89 99 return contents
Note:
See TracChangeset
for help on using the changeset viewer.
