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

Method test_join

Lib/test/test_str.py:554–572  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

552 left + delim * 2 + right, 'rpartition', delim * 2)
553
554 def test_join(self):
555 string_tests.StringLikeTest.test_join(self)
556
557 class MyWrapper:
558 def __init__(self, sval): self.sval = sval
559 def __str__(self): return self.sval
560
561 # mixed arguments
562 self.checkequalnofix('a b c d', ' ', 'join', ['a', 'b', 'c', 'd'])
563 self.checkequalnofix('abcd', '', 'join', ('a', 'b', 'c', 'd'))
564 self.checkequalnofix('w x y z', ' ', 'join', string_tests.Sequence('wxyz'))
565 self.checkequalnofix('a b c d', ' ', 'join', ['a', 'b', 'c', 'd'])
566 self.checkequalnofix('a b c d', ' ', 'join', ['a', 'b', 'c', 'd'])
567 self.checkequalnofix('abcd', '', 'join', ('a', 'b', 'c', 'd'))
568 self.checkequalnofix('w x y z', ' ', 'join', string_tests.Sequence('wxyz'))
569 self.checkraises(TypeError, ' ', 'join', ['1', '2', MyWrapper('foo')])
570 self.checkraises(TypeError, ' ', 'join', ['1', '2', '3', bytes()])
571 self.checkraises(TypeError, ' ', 'join', [1, 2, 3])
572 self.checkraises(TypeError, ' ', 'join', ['1', '2', 3])
573
574 @unittest.skipIf(sys.maxsize > 2**32,
575 'needs too much memory on a 64-bit platform')

Callers

nothing calls this directly

Calls 3

checkequalnofixMethod · 0.95
MyWrapperClass · 0.85
checkraisesMethod · 0.45

Tested by

no test coverage detected