MCPcopy
hub / github.com/pallets/werkzeug / test_dict_is_hashable

Method test_dict_is_hashable

tests/test_datastructures.py:305–320  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

303 assert copy(immutable) is immutable
304
305 def test_dict_is_hashable(self):
306 cls = self.storage_class
307 immutable = cls({"a": 1, "b": 2})
308 immutable2 = cls({"a": 2, "b": 2})
309 x = {immutable}
310 assert immutable in x
311 assert immutable2 not in x
312 x.discard(immutable)
313 assert immutable not in x
314 assert immutable2 not in x
315 x.add(immutable2)
316 assert immutable not in x
317 assert immutable2 in x
318 x.add(immutable)
319 assert immutable in x
320 assert immutable2 in x
321
322 def test_or(self) -> None:
323 a = self.storage_class({"x": 1})

Callers

nothing calls this directly

Calls 2

discardMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected