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

Method test_in_memory_shelf

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected