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

Method test_mul

Lib/test/string_tests.py:111–125  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

109 self.assertEqual(s + self.fixtype('cd'), self.fixtype('abcd'))
110
111 def test_mul(self):
112 s = self.fixtype('ab')
113 self.assertEqual(s*0, self.fixtype(''))
114 self.assertEqual(0*s, self.fixtype(''))
115 self.assertEqual(s*1, s)
116 self.assertEqual(1*s, s)
117 self.assertEqual(s*2, self.fixtype('abab'))
118 self.assertEqual(2*s, self.fixtype('abab'))
119
120 class subclass(self.type2test):
121 pass
122 s = subclass(self.fixtype('ab'))
123 r = s*1
124 self.assertEqual(r, s)
125 self.assertIsNot(r, s)
126
127 def _assert_cmp(self, a, b, r):
128 self.assertIs(a == b, r == 0)

Callers 1

test_mulMethod · 0.45

Calls 4

fixtypeMethod · 0.95
assertIsNotMethod · 0.80
subclassClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected