mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
test_newobj_tuple(), test_newobj_list(): These tests should work under
all protocols, so tried them under all.
This commit is contained in:
parent
5013bd9438
commit
894453a28d
1 changed files with 10 additions and 8 deletions
|
|
@ -555,19 +555,21 @@ def test_newobj_tuple(self):
|
|||
x = MyTuple([1, 2, 3])
|
||||
x.foo = 42
|
||||
x.bar = "hello"
|
||||
s = self.dumps(x, 2)
|
||||
y = self.loads(s)
|
||||
self.assertEqual(tuple(x), tuple(y))
|
||||
self.assertEqual(x.__dict__, y.__dict__)
|
||||
for proto in protocols:
|
||||
s = self.dumps(x, proto)
|
||||
y = self.loads(s)
|
||||
self.assertEqual(tuple(x), tuple(y))
|
||||
self.assertEqual(x.__dict__, y.__dict__)
|
||||
|
||||
def test_newobj_list(self):
|
||||
x = MyList([1, 2, 3])
|
||||
x.foo = 42
|
||||
x.bar = "hello"
|
||||
s = self.dumps(x, 2)
|
||||
y = self.loads(s)
|
||||
self.assertEqual(list(x), list(y))
|
||||
self.assertEqual(x.__dict__, y.__dict__)
|
||||
for proto in protocols:
|
||||
s = self.dumps(x, proto)
|
||||
y = self.loads(s)
|
||||
self.assertEqual(list(x), list(y))
|
||||
self.assertEqual(x.__dict__, y.__dict__)
|
||||
|
||||
def test_newobj_generic(self):
|
||||
for proto in protocols:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue