MCPcopy
hub / github.com/scrapy/scrapy / test_metaclass_inheritance

Method test_metaclass_inheritance

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

Source from the content-addressed store, hash-verified

131 self.assertSortedEqual(list(item.values()), ["New"])
132
133 def test_metaclass_inheritance(self):
134 class ParentItem(Item):
135 name = Field()
136 keys = Field()
137 values = Field()
138
139 class TestItem(ParentItem):
140 keys = Field()
141
142 i = TestItem()
143 i["keys"] = 3
144 assert list(i.keys()) == ["keys"]
145 assert list(i.values()) == [3]
146
147 def test_metaclass_multiple_inheritance_simple(self):
148 class A(Item):

Callers

nothing calls this directly

Calls 3

keysMethod · 0.80
valuesMethod · 0.80
TestItemClass · 0.70

Tested by

no test coverage detected