diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-22 00:06:15 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-22 00:06:15 (GMT) |
commit | c814a38f3f00933f78115f71db284d620f014b53 (patch) | |
tree | 841bd63d7b779b5711bfe72b7224a7dedd0f7e4a /Lib/test/test_unicode.py | |
parent | f01245067a54e3863b7db5e2eebd9f7ca45b29b5 (diff) | |
download | cpython-c814a38f3f00933f78115f71db284d620f014b53.zip cpython-c814a38f3f00933f78115f71db284d620f014b53.tar.gz cpython-c814a38f3f00933f78115f71db284d620f014b53.tar.bz2 |
Add a test on str.__getnewargs__()
It tests indirectly PyUnicode_Copy(): ensure that the string is a copy.
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r-- | Lib/test/test_unicode.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 1ed2058..c63364a 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -1836,6 +1836,13 @@ class UnicodeTest(string_tests.CommonTest, self.assertEqual(transform_decimal('123\u20ac'), '123\u20ac') + def test_getnewargs(self): + text = 'abc' + args = text.__getnewargs__() + self.assertIsNot(args[0], text) + self.assertEqual(args[0], text) + self.assertEqual(len(args), 1) + class StringModuleTest(unittest.TestCase): def test_formatter_parser(self): |