--- a/tests/test-encoding-func.py Sat Oct 05 10:29:34 2019 -0400
+++ b/tests/test-encoding-func.py Sun Oct 06 09:45:02 2019 -0400
@@ -2,9 +2,8 @@
import unittest
-from mercurial import (
- encoding,
-)
+from mercurial import encoding
+
class IsasciistrTest(unittest.TestCase):
asciistrs = [
@@ -28,12 +27,14 @@
t[i] |= 0x80
self.assertFalse(encoding.isasciistr(bytes(t)))
+
class LocalEncodingTest(unittest.TestCase):
def testasciifastpath(self):
s = b'\0' * 100
self.assertTrue(s is encoding.tolocal(s))
self.assertTrue(s is encoding.fromlocal(s))
+
class Utf8bEncodingTest(unittest.TestCase):
def setUp(self):
self.origencoding = encoding.encoding
@@ -75,6 +76,8 @@
self.assertEqual(l, b'\xc5\xed') # lossless
self.assertEqual(s, encoding.toutf8b(l)) # convert back to utf-8
+
if __name__ == '__main__':
import silenttestrunner
+
silenttestrunner.main(__name__)