MCPcopy
hub / github.com/scrapy/scrapy / test_repr

Method test_repr

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

Source from the content-addressed store, hash-verified

49 i["field"]
50
51 def test_repr(self):
52 class TestItem(Item):
53 name = Field()
54 number = Field()
55
56 i = TestItem()
57 i["name"] = "John Doe"
58 i["number"] = 123
59 itemrepr = repr(i)
60
61 assert itemrepr == "{'name': 'John Doe', 'number': 123}"
62
63 i2 = eval(itemrepr)
64 assert i2["name"] == "John Doe"
65 assert i2["number"] == 123
66
67 def test_private_attr(self):
68 class TestItem(Item):

Callers

nothing calls this directly

Calls 1

TestItemClass · 0.70

Tested by

no test coverage detected