mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Moved testing of builtin types out of test_builtin and into type specific modules
This commit is contained in:
parent
761b9c6a53
commit
979395b7a8
7 changed files with 745 additions and 694 deletions
|
@ -17,6 +17,20 @@ class StrTest(
|
|||
def fixtype(self, obj):
|
||||
return obj
|
||||
|
||||
def test_basic_creation(self):
|
||||
self.assertEqual(str(''), '')
|
||||
self.assertEqual(str(0), '0')
|
||||
self.assertEqual(str(0L), '0')
|
||||
self.assertEqual(str(()), '()')
|
||||
self.assertEqual(str([]), '[]')
|
||||
self.assertEqual(str({}), '{}')
|
||||
a = []
|
||||
a.append(a)
|
||||
self.assertEqual(str(a), '[[...]]')
|
||||
a = {}
|
||||
a[0] = a
|
||||
self.assertEqual(str(a), '{0: {...}}')
|
||||
|
||||
def test_formatting(self):
|
||||
string_tests.MixinStrUnicodeUserStringTest.test_formatting(self)
|
||||
self.assertRaises(OverflowError, '%c'.__mod__, 0x1234)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue