def testxml16(self): ''' check xmlnoccheck; read processing_instructions&write processing_instructions''' filenamein = 'botssys/infile/unitinmessagexml/xml/inisout15.xml' filenametmp = 'botssys/infile/unitinmessagexml/output/inisout16tmp.xml' filenameout = 'botssys/infile/unitinmessagexml/output/inisout16.xml' utilsunit.readwrite(editype='xmlnocheck', messagetype='xmlnocheck', filenamein=filenamein, filenameout=filenametmp, processing_instructions=[ ('xml-stylesheet', 'href="mystylesheet.xsl" type="text/xml"'), ('type-of-ppi', 'attr1="value1" attr2="value2"') ]) utilsunit.readwrite(editype='xml', messagetype='xmlorder', filenamein=filenametmp, filenameout=filenameout, processing_instructions=[ ('xml-stylesheet', 'href="mystylesheet.xsl" type="text/xml"'), ('type-of-ppi', 'attr1="value1" attr2="value2"') ]) self.failUnless( filecmp.cmp('bots/' + filenameout, 'bots/' + filenamein))
def testxml11(self): ''' check xml; new behaviour; use standalone parameter''' filenamein='botssys/infile/unitinmessagexml/xml/inisout06.xml' filenameout='botssys/infile/unitinmessagexml/output/inisout11.xml' filenamecmp='botssys/infile/unitinmessagexml/xml/inisout02.xml' utilsunit.readwrite(editype='xml',messagetype='xmlorder',filenamein=filenamein,filenameout=filenameout,standalone=None) self.failUnless(filecmp.cmp('bots/' + filenameout,'bots/' + filenamecmp))
def testxml09(self): ''' BOM;; BOM is not written....''' filenamein='botssys/infile/unitinmessagexml/xml/inisout05.xml' filenamecmp='botssys/infile/unitinmessagexml/xml/inisout04.xml' filenameout='botssys/infile/unitinmessagexml/output/inisout09.xml' utilsunit.readwrite(editype='xml',messagetype='testxml',filenamein=filenamein,filenameout=filenameout,charset='utf-8') self.failUnless(filecmp.cmp('bots/' + filenameout,'bots/' + filenamecmp))
def testxml19(self): ''' check xml; indented; use lot of options.''' filenamein='botssys/infile/unitinmessagexml/xml/inisout02.xml' filenameout='botssys/infile/unitinmessagexml/output/inisout19.xml' filenamecmp='botssys/infile/unitinmessagexml/xml/inisout19.xml' utilsunit.readwrite(editype='xml',messagetype='xmlorder',filenamein=filenamein,filenameout=filenameout,indented=True,standalone='yes',DOCTYPE = 'mydoctype SYSTEM "mydoctype.dtd"',processing_instructions=[('xml-stylesheet' ,'href="mystylesheet.xsl" type="text/xml"'),('type-of-ppi' ,'attr1="value1" attr2="value2"')]) self.failUnless(filecmp.cmp('bots/' + filenameout,'bots/' + filenamecmp))
def testxml05(self): ''' test xml; iso-8859-1''' filenamein='botssys/infile/unitinmessagexml/xml/inisout03.xml' filenamecmp='botssys/infile/unitinmessagexml/xml/inisoutcompare05.xml' filenameout='botssys/infile/unitinmessagexml/output/inisout05.xml' utilsunit.readwrite(editype='xml',messagetype='testxml',filenamein=filenamein,filenameout=filenameout,charset='ISO-8859-1') self.failUnless(filecmp.cmp('bots/' + filenameout,'bots/' + filenamecmp))
def testxml17(self): ''' check xml; read processing_instructions&doctype&comments. Do not write these.''' filenamein='botssys/infile/unitinmessagexml/xml/inisout17.xml' filenameout='botssys/infile/unitinmessagexml/output/inisout17.xml' filenamecmp='botssys/infile/unitinmessagexml/xml/inisout02.xml' utilsunit.readwrite(editype='xml',messagetype='xmlorder',filenamein=filenamein,filenameout=filenameout) self.failUnless(filecmp.cmp('bots/' + filenameout,'bots/' + filenamecmp))
def testxml16(self): ''' check xmlnoccheck; read processing_instructions&write processing_instructions''' filenamein='botssys/infile/unitinmessagexml/xml/inisout15.xml' filenametmp='botssys/infile/unitinmessagexml/output/inisout16tmp.xml' filenameout='botssys/infile/unitinmessagexml/output/inisout16.xml' utilsunit.readwrite(editype='xmlnocheck',messagetype='xmlnocheck',filenamein=filenamein,filenameout=filenametmp,processing_instructions=[('xml-stylesheet' ,'href="mystylesheet.xsl" type="text/xml"'),('type-of-ppi' ,'attr1="value1" attr2="value2"')]) utilsunit.readwrite(editype='xml',messagetype='xmlorder',filenamein=filenametmp,filenameout=filenameout,processing_instructions=[('xml-stylesheet' ,'href="mystylesheet.xsl" type="text/xml"'),('type-of-ppi' ,'attr1="value1" attr2="value2"')]) self.failUnless(filecmp.cmp('bots/' + filenameout,'bots/' + filenamein))
def testxml14(self): ''' check xmlnoccheck; read doctype&write doctype''' filenamein='botssys/infile/unitinmessagexml/xml/inisout13.xml' filenametmp='botssys/infile/unitinmessagexml/output/inisout14tmp.xml' filenameout='botssys/infile/unitinmessagexml/output/inisout14.xml' utilsunit.readwrite(editype='xmlnocheck',messagetype='xmlnocheck',filenamein=filenamein,filenameout=filenametmp,DOCTYPE = 'mydoctype SYSTEM "mydoctype.dtd"') utilsunit.readwrite(editype='xml',messagetype='xmlorder',filenamein=filenametmp,filenameout=filenameout,DOCTYPE = 'mydoctype SYSTEM "mydoctype.dtd"') self.failUnless(filecmp.cmp('bots/' + filenameout,'bots/' + filenamein))
def testxml12(self): ''' check xmlnoccheck; new behaviour use standalone parameter''' filenamein='botssys/infile/unitinmessagexml/xml/inisout06.xml' filenametmp='botssys/infile/unitinmessagexml/output/inisout12tmp.xml' filenameout='botssys/infile/unitinmessagexml/output/inisout12.xml' utilsunit.readwrite(editype='xmlnocheck',messagetype='xmlnocheck',filenamein=filenamein,filenameout=filenametmp,standalone='no') utilsunit.readwrite(editype='xml',messagetype='xmlorder',filenamein=filenametmp,filenameout=filenameout,standalone='no') self.failUnless(filecmp.cmp('bots/' + filenameout,'bots/' + filenamein))
def testxml04(self): ''' check xmlnoccheck''' filenamein='botssys/infile/unitinmessagexml/xml/110419.xml' filenametmp='botssys/infile/unitinmessagexml/output/inisout04tmp.xml' filenameout='botssys/infile/unitinmessagexml/output/inisout04.xml' utilsunit.readwrite(editype='xmlnocheck',messagetype='xmlnocheck',charset='utf-8',filenamein=filenamein,filenameout=filenametmp) utilsunit.readwrite(editype='xml',messagetype='testxmlflatten',charset='utf-8',filenamein=filenametmp,filenameout=filenameout) self.failUnless(filecmp.cmp('bots/' + filenamein,'bots/' + filenameout))
def testxml02a(self): ''' check xmlnoccheck; new behaviour''' filenamein='botssys/infile/unitinmessagexml/xml/inisout02.xml' filenametmp='botssys/infile/unitinmessagexml/output/inisout02tmpa.xml' filenameout='botssys/infile/unitinmessagexml/output/inisout02a.xml' utilsunit.readwrite(editype='xmlnocheck',messagetype='xmlnocheck',filenamein=filenamein,filenameout=filenametmp) utilsunit.readwrite(editype='xml',messagetype='xmlorder',filenamein=filenametmp,filenameout=filenameout) self.failUnless(filecmp.cmp('bots/' + filenameout,'bots/' + filenamein))
def testinisoutjson03(self): ''' non-ascii-char''' filein = 'botssys/infile/unitinmessagejson/org/inisout04.json' fileout = 'botssys/infile/unitinmessagejson/output/inisout04.json' utilsunit.readwrite(editype='json',messagetype='jsonorder',filenamein=filein,filenameout=fileout) inn1 = inmessage.edifromfile(filename=filein,editype='jsonnocheck',messagetype='jsonnocheck') inn2 = inmessage.edifromfile(filename=fileout,editype='jsonnocheck',messagetype='jsonnocheck') self.failUnless(utilsunit.comparenode(inn1.root,inn2.root))
def testinisoutjson01(self): filein = 'botssys/infile/unitinmessagejson/org/inisout01.json' fileout1 = 'botssys/infile/unitinmessagejson/output/inisout01.json' fileout3 = 'botssys/infile/unitinmessagejson/output/inisout03.json' utilsunit.readwrite(editype='json',messagetype='jsonorder',filenamein=filein,filenameout=fileout1) utilsunit.readwrite(editype='jsonnocheck',messagetype='jsonnocheck',filenamein=filein,filenameout=fileout3) inn1 = inmessage.edifromfile(filename=fileout1,editype='jsonnocheck',messagetype='jsonnocheck') inn2 = inmessage.edifromfile(filename=fileout3,editype='jsonnocheck',messagetype='jsonnocheck') self.failUnless(utilsunit.comparenode(inn1.root,inn2.root))
def testcsv001(self): filenamein = 'botssys/infile/unitinisout/org/inisout01.csv' filenameout = 'botssys/infile/unitinisout/output/inisout01.csv' utilsunit.readwrite(editype='csv', messagetype='invoic', filenamein=filenamein, filenameout=filenameout) self.failUnless( filecmp.cmp('bots/' + filenameout, 'bots/' + filenamein))
def testxml03(self): ''' check xml (different grammar)''' filenamein = 'botssys/infile/unitinmessagexml/xml/110419.xml' filenameout = 'botssys/infile/unitinmessagexml/output/inisout03.xml' utilsunit.readwrite(editype='xml', messagetype='testxmlflatten', charset='utf-8', filenamein=filenamein, filenameout=filenameout) self.failUnless( filecmp.cmp('bots/' + filenamein, 'bots/' + filenameout))
def testinisoutjson03(self): ''' non-ascii-char''' filein = 'botssys/infile/unitinmessagejson/org/inisout04.json' fileout = 'botssys/infile/unitinmessagejson/output/inisout04.json' utilsunit.readwrite(editype='json', messagetype='jsonorder', filenamein=filein, filenameout=fileout) inn1 = inmessage.edifromfile(filename=filein, editype='jsonnocheck', messagetype='jsonnocheck') inn2 = inmessage.edifromfile(filename=fileout, editype='jsonnocheck', messagetype='jsonnocheck') self.failUnless(utilsunit.comparenode(inn1.root, inn2.root))
def testinisoutjson01(self): filein = 'botssys/infile/unitinmessagejson/org/inisout01.json' fileout1 = 'botssys/infile/unitinmessagejson/output/inisout01.json' fileout3 = 'botssys/infile/unitinmessagejson/output/inisout03.json' utilsunit.readwrite(editype='json', messagetype='jsonorder', filenamein=filein, filenameout=fileout1) utilsunit.readwrite(editype='jsonnocheck', messagetype='jsonnocheck', filenamein=filein, filenameout=fileout3) inn1 = inmessage.edifromfile(filename=fileout1, editype='jsonnocheck', messagetype='jsonnocheck') inn2 = inmessage.edifromfile(filename=fileout3, editype='jsonnocheck', messagetype='jsonnocheck') self.failUnless(utilsunit.comparenode(inn1.root, inn2.root))
def testcsv003(self): #utf-charset filenamein='botssys/infile/unitinisout/org/inisout03.csv' filenameout='botssys/infile/unitinisout/output/inisout03.csv' utilsunit.readwrite(editype='csv',messagetype='invoic',filenamein=filenamein,filenameout=filenameout) self.failUnless(filecmp.cmp('bots/' + filenameout,'bots/' + filenamein))
def testedifact04(self): utilsunit.readwrite(editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040601.edi', filenameout='botssys/infile/unitinisout/output/040601.edi') utilsunit.readwrite(editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040602.edi', filenameout='botssys/infile/unitinisout/output/040602.edi') utilsunit.readwrite(editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040603.edi', filenameout='botssys/infile/unitinisout/output/040603.edi') utilsunit.readwrite(editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040604.edi', filenameout='botssys/infile/unitinisout/output/040604.edi') utilsunit.readwrite(editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040605.edi', filenameout='botssys/infile/unitinisout/output/040605.edi') utilsunit.readwrite(editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040606.edi', filenameout='botssys/infile/unitinisout/output/040606.edi') utilsunit.readwrite(editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040607.edi', filenameout='botssys/infile/unitinisout/output/040607.edi') utilsunit.readwrite(editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040608.edi', filenameout='botssys/infile/unitinisout/output/040608.edi') self.failUnless(filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi','bots/botssys/infile/unitinisout/output/040602.edi')) self.failUnless(filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi','bots/botssys/infile/unitinisout/output/040603.edi')) self.failUnless(filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi','bots/botssys/infile/unitinisout/output/040604.edi')) self.failUnless(filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi','bots/botssys/infile/unitinisout/output/040605.edi')) self.failUnless(filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi','bots/botssys/infile/unitinisout/output/040606.edi')) self.failUnless(filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi','bots/botssys/infile/unitinisout/output/040607.edi')) self.failUnless(filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi','bots/botssys/infile/unitinisout/output/040608.edi'))
def testxml03(self): ''' check xml (different grammar)''' filenamein='botssys/infile/unitinmessagexml/xml/110419.xml' filenameout='botssys/infile/unitinmessagexml/output/inisout03.xml' utilsunit.readwrite(editype='xml',messagetype='testxmlflatten',charset='utf-8',filenamein=filenamein,filenameout=filenameout) self.failUnless(filecmp.cmp('bots/' + filenamein,'bots/' + filenameout))
def testedifact04(self): utilsunit.readwrite( editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040601.edi', filenameout='botssys/infile/unitinisout/output/040601.edi') utilsunit.readwrite( editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040602.edi', filenameout='botssys/infile/unitinisout/output/040602.edi') utilsunit.readwrite( editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040603.edi', filenameout='botssys/infile/unitinisout/output/040603.edi') utilsunit.readwrite( editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040604.edi', filenameout='botssys/infile/unitinisout/output/040604.edi') utilsunit.readwrite( editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040605.edi', filenameout='botssys/infile/unitinisout/output/040605.edi') utilsunit.readwrite( editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040606.edi', filenameout='botssys/infile/unitinisout/output/040606.edi') utilsunit.readwrite( editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040607.edi', filenameout='botssys/infile/unitinisout/output/040607.edi') utilsunit.readwrite( editype='edifact', messagetype='orderswithenvelope', filenamein='botssys/infile/unitinisout/0406edifact/040608.edi', filenameout='botssys/infile/unitinisout/output/040608.edi') self.failUnless( filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi', 'bots/botssys/infile/unitinisout/output/040602.edi')) self.failUnless( filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi', 'bots/botssys/infile/unitinisout/output/040603.edi')) self.failUnless( filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi', 'bots/botssys/infile/unitinisout/output/040604.edi')) self.failUnless( filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi', 'bots/botssys/infile/unitinisout/output/040605.edi')) self.failUnless( filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi', 'bots/botssys/infile/unitinisout/output/040606.edi')) self.failUnless( filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi', 'bots/botssys/infile/unitinisout/output/040607.edi')) self.failUnless( filecmp.cmp('bots/botssys/infile/unitinisout/output/040601.edi', 'bots/botssys/infile/unitinisout/output/040608.edi'))