/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_export_pot.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-19 10:59:35 UTC
  • mfrom: (6383 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6385.
  • Revision ID: jelmer@canonical.com-20111219105935-9hilixk0anu39v0f
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
322
322
        self.assertNotContainsString(pot, "'protocol=old'")
323
323
 
324
324
 
 
325
class TestPotExporter(tests.TestCase):
 
326
    """Test for logic specific to the _PotExporter class"""
 
327
 
 
328
    # This test duplicates test_duplicates below
 
329
    def test_duplicates(self):
 
330
        exporter = export_pot._PotExporter(StringIO())
 
331
        context = export_pot._ModuleContext("mod.py", 1)
 
332
        exporter.poentry_in_context(context, "Common line.")
 
333
        context.lineno = 3
 
334
        exporter.poentry_in_context(context, "Common line.")
 
335
        self.assertEqual(1, exporter.outf.getvalue().count("Common line."))
 
336
    
 
337
    def test_duplicates_included(self):
 
338
        exporter = export_pot._PotExporter(StringIO(), True)
 
339
        context = export_pot._ModuleContext("mod.py", 1)
 
340
        exporter.poentry_in_context(context, "Common line.")
 
341
        context.lineno = 3
 
342
        exporter.poentry_in_context(context, "Common line.")
 
343
        self.assertEqual(2, exporter.outf.getvalue().count("Common line."))
 
344
 
 
345
 
325
346
class PoEntryTestCase(tests.TestCase):
326
347
 
327
348
    def setUp(self):