Changeset 8e525e1b6b45…
Parent b64e8ded9334…
by
Changes to 2 files · Browse files at 8e525e1b6b45 Showing diff from parent b64e8ded9334 Diff from another changeset...
@@ -1,5 +1,7 @@ import os, tempfile, shutil
+from nose.tools import *
from mercurial import ui, commands, error
+from tortoisehg.util import hglib
from tortoisehg.hgqt import thgrepo
FIXTURES_DIR = os.path.join(os.path.dirname(__file__), 'fixtures')
@@ -29,3 +31,19 @@ return thgrepo.repository(ui.ui(), path)
except error.RepoError:
return create_fixture_repo(name)
+
+
+def with_encoding(encoding, fallbackencoding=None):
+ """Change locale encoding temporarily"""
+ orig_encoding = hglib._encoding
+ orig_fallbackencoding = hglib._fallbackencoding
+
+ def setenc():
+ hglib._encoding = encoding
+ hglib._fallbackencoding = fallbackencoding or encoding
+
+ def restoreenc():
+ hglib._encoding = orig_encoding
+ hglib._fallbackencoding = orig_fallbackencoding
+
+ return with_setup(setenc, restoreenc)
|
@@ -1,21 +1,7 @@ """Test for encoding helper functions of tortoisehg.util.hglib"""
from nose.tools import *
from tortoisehg.util import hglib
-
-def with_encoding(encoding, fallbackencoding=None):
- """Change locale encoding temporarily"""
- orig_encoding = hglib._encoding
- orig_fallbackencoding = hglib._fallbackencoding
-
- def setenc():
- hglib._encoding = encoding
- hglib._fallbackencoding = fallbackencoding or encoding
-
- def restoreenc():
- hglib._encoding = orig_encoding
- hglib._fallbackencoding = orig_fallbackencoding
-
- return with_setup(setenc, restoreenc)
+from tests import with_encoding
JAPANESE_KANA_I = u'\u30a4' # Japanese katakana "i"
|
Loading...