MCPcopy
hub / github.com/pandas-dev/pandas / test_attrs_cols_prefix

Function test_attrs_cols_prefix

pandas/tests/io/xml/test_to_xml.py:418–438  ·  view source on GitHub ↗
(parser, geom_df)

Source from the content-addressed store, hash-verified

416
417
418def test_attrs_cols_prefix(parser, geom_df):
419 expected = """\
420<?xml version='1.0' encoding='utf-8'?>
421<doc:data xmlns:doc="http://example.xom">
422 <doc:row doc:index="0" doc:shape="square" \
423doc:degrees="360" doc:sides="4.0"/>
424 <doc:row doc:index="1" doc:shape="circle" \
425doc:degrees="360"/>
426 <doc:row doc:index="2" doc:shape="triangle" \
427doc:degrees="180" doc:sides="3.0"/>
428</doc:data>"""
429
430 output = geom_df.to_xml(
431 attr_cols=["index", "shape", "degrees", "sides"],
432 namespaces={"doc": "http://example.xom"},
433 prefix="doc",
434 parser=parser,
435 )
436 output = equalize_decl(output)
437
438 assert output == expected
439
440
441def test_attrs_unknown_column(parser, geom_df):

Callers

nothing calls this directly

Calls 2

equalize_declFunction · 0.85
to_xmlMethod · 0.80

Tested by

no test coverage detected