-
Notifications
You must be signed in to change notification settings - Fork 3
/
runit.py
40 lines (33 loc) · 1.36 KB
/
runit.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# coding=utf-8
import os
DPATH = os.path.dirname(os.path.abspath(__file__))
try:
import lxml.etree as ElementTree
except ImportError:
import xml.etree.ElementTree as ElementTree
import PyFePA.serializer as serializer
import PyFePA.siamm as siamm
import datetime
testdata = {'beneficiario': 'IT04578140875',
'tipopagamento': 'AC',
'id': 123,
'entepagante': 'F',
'numerofattura': 'E021',
'registro': 'NOTI',
'datafattura': datetime.datetime.strptime('2014-11-28T00:00:00', '%Y-%m-%dT%H:%M:%S'),
'importototale': 14480.00,
'importoiva': 3185.60,
'nr_rg': '000001/2012',
'sede': '08500402104',
'numeromodello37': None,
'datainizioprestazione': datetime.datetime.strptime('2014-07-31T00:00:00', '%Y-%m-%dT%H:%M:%S'),
'datafineprestazione': datetime.datetime.strptime('2014-10-20T00:00:00', '%Y-%m-%dT%H:%M:%S'),
'nomemagistrato': 'Stefanò'.decode('utf-8'),
'cognomemagistrato': 'Luciani',
'tipointercettazione': 'C'}
with open(DPATH+'/PyFePA/test/IT01234567890_11001.xml', 'rt') as f:
tree = ElementTree.parse(f)
fe = serializer.deserialize(element=tree)
print serializer.serializer(fe,'xml')
testdata_list = [testdata,testdata,testdata]
print siamm.serialize(testdata_list)