diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2007-08-15 07:32:56 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2007-08-15 07:32:56 (GMT) |
commit | 47383403a0a11259acb640406a8efc38981d2255 (patch) | |
tree | ad461e275dc3f2607bab86bb596366d71489b453 /Lib/test/test_unicode.py | |
parent | 32c4ac014387d3bffea5461339b8ad3044d0dafb (diff) | |
download | cpython-47383403a0a11259acb640406a8efc38981d2255.zip cpython-47383403a0a11259acb640406a8efc38981d2255.tar.gz cpython-47383403a0a11259acb640406a8efc38981d2255.tar.bz2 |
Implement PEP 3131. Add isidentifier to str.
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r-- | Lib/test/test_unicode.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 3032f79..4b582de 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -313,6 +313,19 @@ class UnicodeTest( self.assertRaises(TypeError, "abc".isnumeric, 42) + def test_isidentifier(self): + self.assertTrue("a".isidentifier()) + self.assertTrue("Z".isidentifier()) + self.assertTrue("_".isidentifier()) + self.assertTrue("b0".isidentifier()) + self.assertTrue("bc".isidentifier()) + self.assertTrue("b_".isidentifier()) + self.assertTrue("µ".isidentifier()) + + self.assertFalse(" ".isidentifier()) + self.assertFalse("[".isidentifier()) + self.assertFalse("©".isidentifier()) + def test_contains(self): # Testing Unicode contains method self.assert_('a' in 'abdb') |