MCPcopy Index your code
hub / github.com/pyscript/pyscript / test_storage_pop

Function test_storage_pop

core/tests/python/tests/test_storage.py:138–152  ·  view source on GitHub ↗

The pop method should remove and return values.

()

Source from the content-addressed store, hash-verified

136
137
138async def test_storage_pop():
139 """
140 The pop method should remove and return values.
141 """
142 test_store["a"] = 1
143 test_store["b"] = 2
144
145 value = test_store.pop("a")
146 assert value == 1
147 assert "a" not in test_store
148 assert len(test_store) == 1
149
150 # Pop with default.
151 value = test_store.pop("missing", "default")
152 assert value == "default"
153
154
155async def test_storage_persistence():

Callers

nothing calls this directly

Calls 1

popMethod · 0.80

Tested by

no test coverage detected