Hi Andreas,

r401 broke TAB indentation in Emacs 23.  In the attached file, set the cursor
at the end of line 48, then hit return and tab.  Point does not indent.

Cheers,
-Barry

# Copyright (C) 2011 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# GNU Mailman.  If not, see <http://www.gnu.org/licenses/>.

"""Testing i18n template search and interpolation."""

from __future__ import absolute_import, unicode_literals

__metaclass__ = type
__all__ = [
    'test_suite',
    ]


import os
import shutil
import tempfile
import unittest

from zope.component import getUtility

from mailman.config import config
from mailman.interfaces.languages import ILanguageManager
from mailman.testing.layers import ConfigLayer
#from mailman.utilities.i18n import find, make

from mailman.Utils import findtext



class TestFind(unittest.TestCase):
    layer = ConfigLayer

    def setUp(self):
        getUtility(ILanguageManager).add('xx', 'utf-8', 'Xlandia')
        self.template_dir = tempfile.mkdtemp()
        config.push('template config', """\
        [paths.testing]
        template_dir: {0}
        """.format(self.template_dir))
        # Populate global tempdir with a few fake templates.
        self.xx = os.path.join(self.template_dir, 'xx')
        os.mkdir(self.xx)
        with open(os.path.join(self.xx, 'nosub.txt'), 'w') as fp:
            print >> fp, """\
This is a template without substitutions.
"""

    def tearDown(self):
        config.pop('template config')
        shutil.rmtree(self.template_dir)

    def test_find_global_template(self):
        text, filename = findtext('nosub.txt', lang='xx')
        self.assertEqual(text, 'This is a template without substitutions.')
        self.assertEqual(filename, os.path.join(self.xx, 'nosub.txt'))



def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TestFind))
    return suite

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode

Reply via email to