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

Method test_open_template

Lib/test/test_shelve.py:65–74  ·  view source on GitHub ↗
(self, filename=None, protocol=None)

Source from the content-addressed store, hash-verified

63 self.fail('Closed shelf should not find a key')
64
65 def test_open_template(self, filename=None, protocol=None):
66 os.mkdir(self.dirname)
67 self.addCleanup(os_helper.rmtree, self.dirname)
68 s = shelve.open(filename=filename if filename is not None else self.fn,
69 protocol=protocol)
70 try:
71 s['key1'] = (1,2,3,4)
72 self.assertEqual(s['key1'], (1,2,3,4))
73 finally:
74 s.close()
75
76 def test_ascii_file_shelf(self):
77 self.test_open_template(protocol=0)

Calls 5

addCleanupMethod · 0.95
assertEqualMethod · 0.95
mkdirMethod · 0.45
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected