[pypy-svn] r50439 - pypy/branch/ghop-ropes-classes/pypy/rlib/test
vinogradov at codespeak.net
vinogradov at codespeak.net
Mon Jan 7 20:59:56 CET 2008
Author: vinogradov
Date: Mon Jan 7 20:59:56 2008
New Revision: 50439
Modified:
pypy/branch/ghop-ropes-classes/pypy/rlib/test/test_ropewrapper.py
Log:
Add test for string case functions
Modified: pypy/branch/ghop-ropes-classes/pypy/rlib/test/test_ropewrapper.py
==============================================================================
--- pypy/branch/ghop-ropes-classes/pypy/rlib/test/test_ropewrapper.py (original)
+++ pypy/branch/ghop-ropes-classes/pypy/rlib/test/test_ropewrapper.py Mon Jan 7 20:59:56 2008
@@ -63,7 +63,17 @@
def test_str(self):
s1 = self.const("abc")
assert str(s1) == "abc"
-
+
+ def test_str_case(self):
+ s1 = self.const("hello python")
+ assert s1.capitalize() == self.const("Hello python")
+ assert s1.islower()
+ assert not s1.isupper()
+ s2 = s1.upper()
+ assert s2 == self.const("HELLO PYTHON")
+ assert s2.lower() == s1
+ s3 = self.const("Welcome to PyPy World")
+ assert s3.swapcase() == self.const("wELCOME TO pYpY wORLD")
class AbstractRopeTest(object):
def test_add_long(self):
More information about the Pypy-commit
mailing list