(self)
| 2096 | self.assertIn('ababahalamaha', str(cm.exception)) |
| 2097 | |
| 2098 | def testAssertEndsWith(self): |
| 2099 | self.assertEndsWith('ababahalamaha', 'amaha') |
| 2100 | self.assertEndsWith('ababahalamaha', ('x', 'amaha', 'y')) |
| 2101 | self.assertEndsWith(UserString('ababahalamaha'), 'amaha') |
| 2102 | self.assertEndsWith(UserString('ababahalamaha'), ('x', 'amaha', 'y')) |
| 2103 | self.assertEndsWith(bytearray(b'ababahalamaha'), b'amaha') |
| 2104 | self.assertEndsWith(bytearray(b'ababahalamaha'), (b'x', b'amaha', b'y')) |
| 2105 | self.assertEndsWith(b'ababahalamaha', bytearray(b'amaha')) |
| 2106 | self.assertEndsWith(b'ababahalamaha', |
| 2107 | (bytearray(b'x'), bytearray(b'amaha'), bytearray(b'y'))) |
| 2108 | |
| 2109 | with self.assertRaises(self.failureException) as cm: |
| 2110 | self.assertEndsWith('ababahalamaha', 'ababa') |
| 2111 | self.assertEqual(str(cm.exception), |
| 2112 | "'ababahalamaha' doesn't end with 'ababa'") |
| 2113 | with self.assertRaises(self.failureException) as cm: |
| 2114 | self.assertEndsWith('ababahalamaha', ('x', 'y')) |
| 2115 | self.assertEqual(str(cm.exception), |
| 2116 | "'ababahalamaha' doesn't end with any of ('x', 'y')") |
| 2117 | |
| 2118 | with self.assertRaises(self.failureException) as cm: |
| 2119 | self.assertEndsWith(b'ababahalamaha', 'amaha') |
| 2120 | self.assertEqual(str(cm.exception), 'Expected str, not bytes') |
| 2121 | with self.assertRaises(self.failureException) as cm: |
| 2122 | self.assertEndsWith(b'ababahalamaha', ('ababa', 'amaha')) |
| 2123 | self.assertEqual(str(cm.exception), 'Expected str, not bytes') |
| 2124 | with self.assertRaises(self.failureException) as cm: |
| 2125 | self.assertEndsWith([], 'amaha') |
| 2126 | self.assertEqual(str(cm.exception), 'Expected str, not list') |
| 2127 | with self.assertRaises(self.failureException) as cm: |
| 2128 | self.assertEndsWith('ababahalamaha', b'amaha') |
| 2129 | self.assertEqual(str(cm.exception), 'Expected bytes, not str') |
| 2130 | with self.assertRaises(self.failureException) as cm: |
| 2131 | self.assertEndsWith('ababahalamaha', (b'ababa', b'amaha')) |
| 2132 | self.assertEqual(str(cm.exception), 'Expected bytes, not str') |
| 2133 | with self.assertRaises(TypeError): |
| 2134 | self.assertEndsWith('ababahalamaha', ord('a')) |
| 2135 | |
| 2136 | with self.assertRaises(self.failureException) as cm: |
| 2137 | self.assertEndsWith('ababahalamaha', 'ababa', 'abracadabra') |
| 2138 | self.assertIn('ababahalamaha', str(cm.exception)) |
| 2139 | with self.assertRaises(self.failureException) as cm: |
| 2140 | self.assertEndsWith('ababahalamaha', 'ababa', msg='abracadabra') |
| 2141 | self.assertIn('ababahalamaha', str(cm.exception)) |
| 2142 | |
| 2143 | def testAssertNotEndsWith(self): |
| 2144 | self.assertNotEndsWith('ababahalamaha', 'ababa') |
nothing calls this directly
no test coverage detected