MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_open_template

Method test_open_template

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

Source from the content-addressed store, hash-verified

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