Example #1
0
 def test_duplicates_included(self):
     exporter = export_pot._PotExporter(StringIO(), True)
     context = export_pot._ModuleContext("mod.py", 1)
     exporter.poentry_in_context(context, "Common line.")
     context.lineno = 3
     exporter.poentry_in_context(context, "Common line.")
     self.assertEqual(2, exporter.outf.getvalue().count("Common line."))
Example #2
0
 def pot_from_option(self, opt, context=None, note="test"):
     sio = StringIO()
     exporter = export_pot._PotExporter(sio)
     if context is None:
         context = export_pot._ModuleContext("nowhere", 0)
     export_pot._write_option(exporter, context, opt, note)
     return sio.getvalue()
Example #3
0
 def test_duplicates_included(self):
     exporter = export_pot._PotExporter(StringIO(), True)
     context = export_pot._ModuleContext("mod.py", 1)
     exporter.poentry_in_context(context, "Common line.")
     context.lineno = 3
     exporter.poentry_in_context(context, "Common line.")
     self.assertEqual(2, exporter.outf.getvalue().count("Common line."))
Example #4
0
 def pot_from_option(self, opt, context=None, note="test"):
     sio = StringIO()
     exporter = export_pot._PotExporter(sio)
     if context is None:
         context = export_pot._ModuleContext("nowhere", 0)
     export_pot._write_option(exporter, context, opt, note)
     return sio.getvalue()
Example #5
0
 def setUp(self):
     super(PoEntryTestCase, self).setUp()
     self.exporter = export_pot._PotExporter(StringIO())
Example #6
0
 def setUp(self):
     super(PoEntryTestCase, self).setUp()
     self.exporter = export_pot._PotExporter(StringIO())