MCPcopy
hub / github.com/scrapy/scrapy / test_nested_list_item

Method test_nested_list_item

tests/test_exporters.py:459–477  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

457 )
458
459 def test_nested_list_item(self):
460 i1 = {"name": "foo"}
461 i2 = {"name": "bar", "v2": {"egg": ["spam"]}}
462 i3 = self.item_class(name="buz", age=[i1, i2])
463
464 self.assertExportResult(
465 i3,
466 b"""<?xml version="1.0" encoding="utf-8"?>\n
467 <items>
468 <item>
469 <age>
470 <value><name>foo</name></value>
471 <value><name>bar</name><v2><egg><value>spam</value></egg></v2></value>
472 </age>
473 <name>buz</name>
474 </item>
475 </items>
476 """,
477 )
478
479 def test_nonstring_types_item(self):
480 item = self._get_nonstring_types_item()

Callers

nothing calls this directly

Calls 2

assertExportResultMethod · 0.95
item_classMethod · 0.45

Tested by

no test coverage detected