Home | History | Annotate | Download | only in test

Lines Matching refs:strop

2 warnings.filterwarnings("ignore", "strop functions are obsolete;",
9 strop = test_support.import_module("strop")
15 self.assertTrue(strop.atoi(" 1 ") == 1)
16 self.assertRaises(ValueError, strop.atoi, " 1x")
17 self.assertRaises(ValueError, strop.atoi, " x1 ")
20 self.assertTrue(strop.atol(" 1 ") == 1L)
21 self.assertRaises(ValueError, strop.atol, " 1x")
22 self.assertRaises(ValueError, strop.atol, " x1 ")
25 self.assertTrue(strop.atof(" 1 ") == 1.0)
26 self.assertRaises(ValueError, strop.atof, " 1x")
27 self.assertRaises(ValueError, strop.atof, " x1 ")
30 self.assertTrue(strop.capitalize(" hello ") == " hello ")
31 self.assertTrue(strop.capitalize("hello ") == "Hello ")
34 self.assertTrue(strop.find("abcdefghiabc", "abc") == 0)
35 self.assertTrue(strop.find("abcdefghiabc", "abc", 1) == 9)
36 self.assertTrue(strop.find("abcdefghiabc", "def", 4) == -1)
39 self.assertTrue(strop.rfind("abcdefghiabc", "abc") == 9)
42 self.assertTrue(strop.lower("HeLLo") == "hello")
45 self.assertTrue(strop.upper("HeLLo") == "HELLO")
48 self.assertTrue(strop.swapcase("HeLLo cOmpUteRs") == "hEllO CoMPuTErS")
51 self.assertTrue(strop.strip(" \t\n hello \t\n ") == "hello")
54 self.assertTrue(strop.lstrip(" \t\n hello \t\n ") == "hello \t\n ")
57 self.assertTrue(strop.rstrip(" \t\n hello \t\n ") == " \t\n hello")
60 replace = strop.replace
70 # CAUTION: a replace count of 0 means infinity only to strop,
84 split = strop.split
97 self.assertTrue(strop.join(['a', 'b', 'c', 'd']) == 'a b c d')
98 self.assertTrue(strop.join(('a', 'b', 'c', 'd'), '') == 'abcd')
99 self.assertTrue(strop.join(Sequence()) == 'w x y z')
102 self.assertTrue(strop.join(['x' * 100] * 100, ':')
104 self.assertTrue(strop.join(('x' * 100,) * 100, ':')
108 self.assertTrue(strop.maketrans("abc", "xyz") == transtable)
109 self.assertRaises(ValueError, strop.maketrans, "abc", "xyzq")
112 self.assertTrue(strop.translate("xyzabcdef", transtable, "def")
116 strop.lowercase
117 strop.uppercase
118 strop.whitespace
123 self.assertRaises(OverflowError, strop.expandtabs, s, 0x10001)
129 r = strop.join([a, a], a)
139 r = strop.join((a, a), a)
148 self.assertRaises(MemoryError, strop.replace, a, "A", a)