Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82ed191bc9 | ||
|
|
92ff315fb4 | ||
|
|
f4cebdc054 |
@@ -0,0 +1,20 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2016 Adrien Vergé
|
||||||
|
#
|
||||||
|
# This program 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.
|
||||||
|
#
|
||||||
|
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import locale
|
||||||
|
|
||||||
|
|
||||||
|
locale.setlocale(locale.LC_ALL, 'C')
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ try:
|
|||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
import locale
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
@@ -273,10 +274,17 @@ class CommandLineTestCase(unittest.TestCase):
|
|||||||
def test_run_non_ascii_file(self):
|
def test_run_non_ascii_file(self):
|
||||||
file = os.path.join(self.wd, 'non-ascii', 'utf-8')
|
file = os.path.join(self.wd, 'non-ascii', 'utf-8')
|
||||||
|
|
||||||
|
# Make sure the default localization conditions on this "system"
|
||||||
|
# support UTF-8 encoding.
|
||||||
|
loc = locale.getlocale()
|
||||||
|
locale.setlocale(locale.LC_ALL, 'C.UTF-8')
|
||||||
|
|
||||||
sys.stdout, sys.stderr = StringIO(), StringIO()
|
sys.stdout, sys.stderr = StringIO(), StringIO()
|
||||||
with self.assertRaises(SystemExit) as ctx:
|
with self.assertRaises(SystemExit) as ctx:
|
||||||
cli.run(('-f', 'parsable', file))
|
cli.run(('-f', 'parsable', file))
|
||||||
|
|
||||||
|
locale.setlocale(locale.LC_ALL, loc)
|
||||||
|
|
||||||
self.assertEqual(ctx.exception.code, 0)
|
self.assertEqual(ctx.exception.code, 0)
|
||||||
|
|
||||||
out, err = sys.stdout.getvalue(), sys.stderr.getvalue()
|
out, err = sys.stdout.getvalue(), sys.stderr.getvalue()
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ indentation, etc."""
|
|||||||
|
|
||||||
|
|
||||||
APP_NAME = 'yamllint'
|
APP_NAME = 'yamllint'
|
||||||
APP_VERSION = '1.3.1'
|
APP_VERSION = '1.3.2'
|
||||||
APP_DESCRIPTION = __doc__
|
APP_DESCRIPTION = __doc__
|
||||||
|
|
||||||
__author__ = u'Adrien Vergé'
|
__author__ = u'Adrien Vergé'
|
||||||
|
|||||||
Reference in New Issue
Block a user