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

Method test_in_memory_shelf

Lib/test/test_shelve.py:94–106  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

92 self.test_open_template(filename=os_helper.FakePath(os.fsencode(self.fn)))
93
94 def test_in_memory_shelf(self):
95 d1 = byteskeydict()
96 with shelve.Shelf(d1, protocol=0) as s:
97 s['key1'] = (1,2,3,4)
98 self.assertEqual(s['key1'], (1,2,3,4))
99 d2 = byteskeydict()
100 with shelve.Shelf(d2, protocol=1) as s:
101 s['key1'] = (1,2,3,4)
102 self.assertEqual(s['key1'], (1,2,3,4))
103
104 self.assertEqual(len(d1), 1)
105 self.assertEqual(len(d2), 1)
106 self.assertNotEqual(d1.items(), d2.items())
107
108 def test_mutable_entry(self):
109 d1 = byteskeydict()

Callers

nothing calls this directly

Calls 4

assertEqualMethod · 0.95
assertNotEqualMethod · 0.95
byteskeydictClass · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected