Aaron Iles avatar Aaron Iles committed 607f5b9

Add tests for unicodeobjects against is* methods.

Comments (0)

Files changed (1)

pypy/objspace/std/test/test_unicodeobject.py

         assert u"Brown Fox".title() == u"Brown Fox"
         assert u"bro!wn fox".title() == u"Bro!Wn Fox"
 
+    def test_isalnum(self):
+        assert u"".isalnum() == False
+        assert u"!Bro12345w&&&&n Fox".isalnum() == False
+        assert u"125 Brown Foxes".isalnum() == False
+        assert u"125BrownFoxes".isalnum() == True
+
+    def test_isalpha(self):
+        assert u"".isalpha() == False
+        assert u"!Bro12345w&&&&nFox".isalpha() == False
+        assert u"Brown Foxes".isalpha() == False
+        assert u"125".isalpha() == False
+
+    def test_isdigit(self):
+        assert u"".isdigit() == False
+        assert u"!Bro12345w&&&&nFox".isdigit() == False
+        assert u"Brown Foxes".isdigit() == False
+        assert u"125".isdigit() == True
+
+    def test_isdecimal(self):
+        assert u"".isdecimal() == False
+        assert u"42!".isdecimal() == False
+        assert u"\t1337".isdecimal() == False
+        assert u"6".isdecimal() == True
+
+    def test_isspace(self):
+        assert u"".isspace() == False
+        assert u"!Bro12345w&&&&nFox".isspace() == False
+        assert u" ".isspace() ==  True
+        assert u"\t\t\b\b\n".isspace() == False
+        assert u"\t\t".isspace() == True
+        assert u"\t\t\r\r\n".isspace() == True
+
+    def test_islower(self):
+        assert u"".islower() == False
+        assert u" ".islower() ==  False
+        assert u"\t\t\b\b\n".islower() == False
+        assert u"b".islower() == True
+        assert u"bbb".islower() == True
+        assert u"!bbb".islower() == True
+        assert u"BBB".islower() == False
+        assert u"bbbBBB".islower() == False
+
+    def test_isupper(self):
+        assert u"".isupper() == False
+        assert u" ".isupper() ==  False
+        assert u"\t\t\b\b\n".isupper() == False
+        assert u"B".isupper() == True
+        assert u"BBB".isupper() == True
+        assert u"!BBB".isupper() == True
+        assert u"bbb".isupper() == False
+        assert u"BBBbbb".isupper() == False
+
     def test_istitle(self):
         assert u"".istitle() == False
         assert u"!".istitle() == False
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.