mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Port the dictionary tests from test_types.py to unittest. Collect as much
mapping tests as possible in mapping_test.py and reuse the tests in test_dict.py, test_userdict.py, test_weakref.py, test_os.py and test_shelve.py. From SF patch #736962.
This commit is contained in:
parent
cbd0b365c1
commit
0a6d0ff8d9
7 changed files with 704 additions and 360 deletions
|
@ -74,14 +74,14 @@ class TestCase(unittest.TestCase):
|
|||
self.assertEqual(len(d2), 1)
|
||||
|
||||
|
||||
from test_userdict import TestMappingProtocol
|
||||
from test import mapping_tests
|
||||
|
||||
class TestShelveBase(TestMappingProtocol):
|
||||
class TestShelveBase(mapping_tests.BasicTestMappingProtocol):
|
||||
fn = "shelftemp.db"
|
||||
counter = 0
|
||||
def __init__(self, *args, **kw):
|
||||
self._db = []
|
||||
TestMappingProtocol.__init__(self, *args, **kw)
|
||||
mapping_tests.BasicTestMappingProtocol.__init__(self, *args, **kw)
|
||||
_tested_class = shelve.Shelf
|
||||
def _reference(self):
|
||||
return {"key1":"value1", "key2":2, "key3":(1,2,3)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue