MCPcopy
hub / github.com/scrapy/scrapy / test_metaclass_with_fields_attribute

Method test_metaclass_with_fields_attribute

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

Source from the content-addressed store, hash-verified

123 self.assertSortedEqual(list(i.values()), ["Keys", "Values", "John"])
124
125 def test_metaclass_with_fields_attribute(self):
126 class TestItem(Item):
127 fields = {"new": Field(default="X")}
128
129 item = TestItem(new="New")
130 self.assertSortedEqual(list(item.keys()), ["new"])
131 self.assertSortedEqual(list(item.values()), ["New"])
132
133 def test_metaclass_inheritance(self):
134 class ParentItem(Item):

Callers

nothing calls this directly

Calls 4

assertSortedEqualMethod · 0.95
keysMethod · 0.80
valuesMethod · 0.80
TestItemClass · 0.70

Tested by

no test coverage detected