MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_join

Method test_join

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

Source from the content-addressed store, hash-verified

545 left + delim * 2 + right, 'rpartition', delim * 2)
546
547 def test_join(self):
548 string_tests.StringLikeTest.test_join(self)
549
550 class MyWrapper:
551 def __init__(self, sval): self.sval = sval
552 def __str__(self): return self.sval
553
554 # mixed arguments
555 self.checkequalnofix('a b c d', ' ', 'join', ['a', 'b', 'c', 'd'])
556 self.checkequalnofix('abcd', '', 'join', ('a', 'b', 'c', 'd'))
557 self.checkequalnofix('w x y z', ' ', 'join', string_tests.Sequence('wxyz'))
558 self.checkequalnofix('a b c d', ' ', 'join', ['a', 'b', 'c', 'd'])
559 self.checkequalnofix('a b c d', ' ', 'join', ['a', 'b', 'c', 'd'])
560 self.checkequalnofix('abcd', '', 'join', ('a', 'b', 'c', 'd'))
561 self.checkequalnofix('w x y z', ' ', 'join', string_tests.Sequence('wxyz'))
562 self.checkraises(TypeError, ' ', 'join', ['1', '2', MyWrapper('foo')])
563 self.checkraises(TypeError, ' ', 'join', ['1', '2', '3', bytes()])
564 self.checkraises(TypeError, ' ', 'join', [1, 2, 3])
565 self.checkraises(TypeError, ' ', 'join', ['1', '2', 3])
566
567 @unittest.skipIf(sys.maxsize > 2**32,
568 '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