MCPcopy
hub / github.com/scrapy/scrapy / test_copy

Method test_copy

tests/test_item.py:250–258  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

248 assert dict(i) == {"name": "John"}
249
250 def test_copy(self):
251 class TestItem(Item):
252 name = Field()
253
254 item = TestItem({"name": "lower"})
255 copied_item = item.copy()
256 assert id(item) != id(copied_item)
257 copied_item["name"] = copied_item["name"].upper()
258 assert item["name"] != copied_item["name"]
259
260 def test_deepcopy(self):
261 class TestItem(Item):

Callers

nothing calls this directly

Calls 2

TestItemClass · 0.70
copyMethod · 0.45

Tested by

no test coverage detected