Exemplo n.º 1
0
 def convertphp(self, phpsource, template=None, expected=1):
     """call run_converter, return the outputfile"""
     inputfile = wStringIO.StringIO(phpsource)
     outputfile = wStringIO.StringIO()
     templatefile = None
     if template:
         templatefile = wStringIO.StringIO(template)
     assert php2po.run_converter(inputfile, outputfile, templatefile) == expected
     return outputfile.getvalue()
Exemplo n.º 2
0
 def convertphp(self, phpsource, template=None, expected=1):
     """call run_converter, return the outputfile"""
     inputfile = wStringIO.StringIO(phpsource)
     outputfile = wStringIO.StringIO()
     templatefile = None
     if template:
         templatefile = wStringIO.StringIO(template)
     assert php2po.run_converter(inputfile, outputfile, templatefile) == expected
     return outputfile.getvalue()
Exemplo n.º 3
0
 def convertphp(phpsource, template=None, expected=1):
     """call run_converter, return the outputfile"""
     inputfile = BytesIO(phpsource.encode())
     outputfile = BytesIO()
     templatefile = None
     if template:
         templatefile = BytesIO(template.encode())
     assert php2po.run_converter(inputfile, outputfile,
                                 templatefile) == expected
     return outputfile.getvalue()