MCPcopy Index your code
hub / github.com/python/cpython / test_string

Method test_string

Lib/test/test_bool.py:216–240  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

214 self.assertIs(1 in {1:1}, True)
215
216 def test_string(self):
217 self.assertIs("xyz".endswith("z"), True)
218 self.assertIs("xyz".endswith("x"), False)
219 self.assertIs("xyz0123".isalnum(), True)
220 self.assertIs("@#$%".isalnum(), False)
221 self.assertIs("xyz".isalpha(), True)
222 self.assertIs("@#$%".isalpha(), False)
223 self.assertIs("0123".isdigit(), True)
224 self.assertIs("xyz".isdigit(), False)
225 self.assertIs("xyz".islower(), True)
226 self.assertIs("XYZ".islower(), False)
227 self.assertIs("0123".isdecimal(), True)
228 self.assertIs("xyz".isdecimal(), False)
229 self.assertIs("0123".isnumeric(), True)
230 self.assertIs("xyz".isnumeric(), False)
231 self.assertIs(" ".isspace(), True)
232 self.assertIs("\xa0".isspace(), True)
233 self.assertIs("\u3000".isspace(), True)
234 self.assertIs("XYZ".isspace(), False)
235 self.assertIs("X".istitle(), True)
236 self.assertIs("x".istitle(), False)
237 self.assertIs("XYZ".isupper(), True)
238 self.assertIs("xyz".isupper(), False)
239 self.assertIs("xyz".startswith("x"), True)
240 self.assertIs("xyz".startswith("z"), False)
241
242 def test_boolean(self):
243 self.assertEqual(True & 1, 1)

Callers

nothing calls this directly

Calls 12

isalnumMethod · 0.80
isalphaMethod · 0.80
isdigitMethod · 0.80
islowerMethod · 0.80
isdecimalMethod · 0.80
isnumericMethod · 0.80
isspaceMethod · 0.80
istitleMethod · 0.80
isupperMethod · 0.80
assertIsMethod · 0.45
endswithMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected