How to tag. #182
GitHub Actions / Tests results
failed
Jan 11, 2024 in 0s
Annotations
Check warning on line 0 in tests.unit.media_backend_util_test.Tests
github-actions / Tests results
test_parse_list (tests.unit.media_backend_util_test.Tests) failed
junit/test-results.xml [took 0s]
Raw output
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
self = <tests.unit.media_backend_util_test.Tests testMethod=test_parse_list>
def test_parse_list(self):
xml = """<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<list xmlns="urn:vpro:media:update:2009" xmlns:media="urn:vpro:media:2009" xmlns:shared="urn:vpro:shared:2009" offset="0" totalCount="5" max="200" order="ASC" size="5">
<item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="memberUpdateType" position="1" highlighted="false">
<mediaUpdate xsi:type="programUpdateType" type="TRACK" avType="AUDIO" embeddable="true" mid="WO_VPRO_422840" urn="urn:vpro:media:program:31357971">
<broadcaster>VPRO</broadcaster>
<title type="MAIN">Sweaty Fingers</title>
<duration>P0DT0H11M53.000S</duration>
<memberOf position="1" highlighted="false">WO_S_VPRO_422849</memberOf>
<locations>
<location urn="urn:vpro:media:location:31357975">
<programUrl>odis+http://content.omroep.nl/vpro/protected/luisterpaal/albums/world/WO_S_VPRO_422849/track01.mp3</programUrl>
<avAttributes>
<bitrate>112</bitrate>
<avFileFormat>MP3</avFileFormat>
<audioAttributes>
<channels>2</channels>
<coding>MP3</coding>
</audioAttributes>
</avAttributes>
<duration>P0DT0H11M53.000S</duration>
</location>
</locations>
<scheduleEvents/>
<relation type="ARTIST" broadcaster="VPRO" urn="urn:vpro:media:relation:31357976">Cave</relation>
<images>
<image type="PICTURE" highlighted="false">
<title>Cave - Threace</title>
<description>Cover image</description>
<urn>urn:vpro:image:236672</urn>
</image>
</images>
<segments/>
</mediaUpdate>
</item>
<item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="memberUpdateType" position="2" highlighted="false">
<mediaUpdate xsi:type="programUpdateType" type="TRACK" avType="AUDIO" embeddable="true" mid="WO_VPRO_422839" urn="urn:vpro:media:program:31357951">
<broadcaster>VPRO</broadcaster>
<title type="MAIN">Silver Headband</title>
<duration>P0DT0H8M53.000S</duration>
<memberOf position="2" highlighted="false">WO_S_VPRO_422849</memberOf>
<locations>
<location urn="urn:vpro:media:location:31357955">
<programUrl>odis+http://content.omroep.nl/vpro/protected/luisterpaal/albums/world/WO_S_VPRO_422849/track02.mp3</programUrl>
<avAttributes>
<bitrate>112</bitrate>
<avFileFormat>MP3</avFileFormat>
<audioAttributes>
<channels>2</channels>
<coding>MP3</coding>
</audioAttributes>
</avAttributes>
<duration>P0DT0H8M53.000S</duration>
</location>
</locations>
<scheduleEvents/>
<relation type="ARTIST" broadcaster="VPRO" urn="urn:vpro:media:relation:31357956">Cave</relation>
<images>
<image type="PICTURE" highlighted="false">
<title>Cave - Threace</title>
<description>Cover image</description>
<urn>urn:vpro:image:236672</urn>
</image>
</images>
<segments/>
</mediaUpdate>
</item>
<item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="memberUpdateType" position="3" highlighted="false">
<mediaUpdate xsi:type="programUpdateType" type="TRACK" avType="AUDIO" embeddable="true" mid="WO_VPRO_422842" urn="urn:vpro:media:program:31357990">
<broadcaster>VPRO</broadcaster>
<title type="MAIN">Arrow's Myth</title>
<duration>P0DT0H8M49.000S</duration>
<memberOf position="3" highlighted="false">WO_S_VPRO_422849</memberOf>
<locations>
<location urn="urn:vpro:media:location:31357994">
<programUrl>odis+http://content.omroep.nl/vpro/protected/luisterpaal/albums/world/WO_S_VPRO_422849/track03.mp3</programUrl>
<avAttributes>
<bitrate>112</bitrate>
<avFileFormat>MP3</avFileFormat>
<audioAttributes>
<channels>2</channels>
<coding>MP3</coding>
</audioAttributes>
</avAttributes>
<duration>P0DT0H8M49.000S</duration>
</location>
</locations>
<scheduleEvents/>
<relation type="ARTIST" broadcaster="VPRO" urn="urn:vpro:media:relation:31357995">Cave</relation>
<images>
<image type="PICTURE" highlighted="false">
<title>Cave - Threace</title>
<description>Cover image</description>
<urn>urn:vpro:image:236672</urn>
</image>
</images>
<segments/>
</mediaUpdate>
</item>
<item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="memberUpdateType" position="4" highlighted="false">
<mediaUpdate xsi:type="programUpdateType" type="TRACK" avType="AUDIO" embeddable="true" mid="WO_VPRO_422843" urn="urn:vpro:media:program:31357998">
<broadcaster>VPRO</broadcaster>
<title type="MAIN">Shikaakwa</title>
<duration>P0DT0H5M2.000S</duration>
<memberOf position="4" highlighted="false">WO_S_VPRO_422849</memberOf>
<locations>
<location urn="urn:vpro:media:location:31358002">
<programUrl>odis+http://content.omroep.nl/vpro/protected/luisterpaal/albums/world/WO_S_VPRO_422849/track04.mp3</programUrl>
<avAttributes>
<bitrate>112</bitrate>
<avFileFormat>MP3</avFileFormat>
<audioAttributes>
<channels>2</channels>
<coding>MP3</coding>
</audioAttributes>
</avAttributes>
<duration>P0DT0H5M2.000S</duration>
</location>
</locations>
<scheduleEvents/>
<relation type="ARTIST" broadcaster="VPRO" urn="urn:vpro:media:relation:31358003">Cave</relation>
<images>
<image type="PICTURE" highlighted="false">
<title>Cave - Threace</title>
<description>Cover image</description>
<urn>urn:vpro:image:236672</urn>
</image>
</images>
<segments/>
</mediaUpdate>
</item>
<item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="memberUpdateType" position="5" highlighted="false">
<mediaUpdate xsi:type="programUpdateType" type="TRACK" avType="AUDIO" embeddable="true" mid="WO_VPRO_422841" urn="urn:vpro:media:program:31357982">
<broadcaster>VPRO</broadcaster>
<title type="MAIN">Slow Bern</title>
<duration>P0DT0H7M14.000S</duration>
<memberOf position="5" highlighted="false">WO_S_VPRO_422849</memberOf>
<locations>
<location urn="urn:vpro:media:location:31357986">
<programUrl>odis+http://content.omroep.nl/vpro/protected/luisterpaal/albums/world/WO_S_VPRO_422849/track05.mp3</programUrl>
<avAttributes>
<bitrate>112</bitrate>
<avFileFormat>MP3</avFileFormat>
<audioAttributes>
<channels>2</channels>
<coding>MP3</coding>
</audioAttributes>
</avAttributes>
<duration>P0DT0H7M14.000S</duration>
</location>
</locations>
<scheduleEvents/>
<relation type="ARTIST" broadcaster="VPRO" urn="urn:vpro:media:relation:31357987">Cave</relation>
<images>
<image type="PICTURE" highlighted="false">
<title>Cave - Threace</title>
<description>Cover image</description>
<urn>urn:vpro:image:236672</urn>
</image>
</images>
<segments/>
</mediaUpdate>
</item>
</list>
"""
mapped = list(MU.iterate_objects(xml))
> self.xmlAssert("""
<program avType="AUDIO" embeddable="true" mid="WO_VPRO_422840" type="TRACK" urn="urn:vpro:media:program:31357971" xmlns="urn:vpro:media:update:2009"><broadcaster>VPRO</broadcaster><title type="MAIN">Sweaty Fingers</title><duration>PT11M53S</duration><memberOf highlighted="false" position="1">WO_S_VPRO_422849</memberOf><locations><location urn="urn:vpro:media:location:31357975"><programUrl>odis+http://content.omroep.nl/vpro/protected/luisterpaal/albums/world/WO_S_VPRO_422849/track01.mp3</programUrl><avAttributes><bitrate>112</bitrate><avFileFormat>MP3</avFileFormat><audioAttributes><channels>2</channels><coding>MP3</coding></audioAttributes></avAttributes><duration>PT11M53S</duration></location></locations><scheduleEvents/><relation broadcaster="VPRO" type="ARTIST" urn="urn:vpro:media:relation:31357976">Cave</relation><images><image highlighted="false" type="PICTURE"><title>Cave - Threace</title><description>Cover image</description><urn>urn:vpro:image:236672</urn></image></images><segments/></program>
""", poms.serializer.render(mapped[0]))
tests/unit/media_backend_util_test.py:207:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/unit/media_backend_util_test.py:18: in xmlAssert
self.assertEqual([],main.diff_texts(expected.strip(), real))
/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/xmldiff/main.py:44: in diff_texts
return _diff(
/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/xmldiff/main.py:36: in _diff
right_tree = parse_method(right, parser)
src/lxml/etree.pyx:3264: in lxml.etree.fromstring
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
src/lxml/parser.pxi:1911: ValueError
Check warning on line 0 in tests.unit.media_backend_util_test.Tests
github-actions / Tests results
test_segments_as_members (tests.unit.media_backend_util_test.Tests) failed
junit/test-results.xml [took 0s]
Raw output
xsdata.exceptions.ParserError: Unknown property programUpdateType:{urn:vpro:media:update:2009}start
self = <tests.unit.media_backend_util_test.Tests testMethod=test_segments_as_members>
def test_segments_as_members(self):
xml = """
<program xmlns="urn:vpro:media:update:2009" xmlns:media="urn:vpro:media:2009" xmlns:shared="urn:vpro:shared:2009" type="BROADCAST" avType="AUDIO" embeddable="true" mid="RBX_NOS_703622" urn="urn:vpro:media:program:47853525">
<crid>crid://broadcast.radiobox2/309347</crid>
<broadcaster>NOS</broadcaster>
<title type="MAIN">NOS-Radio 1-Journaal</title>
<description type="MAIN">Nieuws en actualiteiten.</description>
<locations/>
<scheduleEvents>
<scheduleEvent channel="RAD1">
<start>2015-04-22T06:00:00.000+02:00</start>
<duration>P0DT3H0M0.000S</duration>
</scheduleEvent>
</scheduleEvents>
<images/>
<episodeOf position="1" highlighted="false">RBX_S_NOS_553954</episodeOf>
<segments>
<segment midRef="RBX_NOS_703622" avType="AUDIO" embeddable="true" mid="RBX_NOS_839624" urn="urn:vpro:media:segment:54408153">
<crid>crid://audiofragment.radiobox2/182587</crid>
<broadcaster>NOS</broadcaster>
<title type="MAIN">Actievoerende agenten rijden langzaam op snelweg</title>
<description type="MAIN">
In Groningen is de landelijke politieactie op de snelwegen begonnen. Politiewagens rijden met 60 kilometer per uur over de volle breedte van snelwegen naar het zuiden. De actie eindigt vanavond in Maastricht. Onderweg sluiten andere agenten zich vanuit het hele land bij de actie aan.De politie houdt de langzaamaanacties om aandacht te vragen voor het cao-conflict met minister Van der Steur. De agenten willen onder meer een hoger salaris. Vorige maand hielden ze al een sireneprotest.VertragingDe estafetteactie van vandaag gaat tot ongeveer 20.00 uur duren. Dan komen de laatste politiewagens in Maastricht aan.Rijkswaterstaat verwacht dat de langzaam rijdende wagens veel vertraging veroorzaken, vooral in de middag bij Rotterdam en tijdens de avondspits in Noord-Brabant.
</description>
<duration>P0DT0H3M14.000S</duration>
<locations/>
<scheduleEvents/>
<images/>
<start>P0DT0H12M44.000S</start>
</segment>
<segment midRef="RBX_NOS_703622" avType="AUDIO" embeddable="true" mid="RBX_NOS_839600" urn="urn:vpro:media:segment:54407864">
<crid>crid://audiofragment.radiobox2/182585</crid>
<broadcaster>NOS</broadcaster>
<title type="MAIN">Saudi-Arabië begint 'nieuwe fase' in Jemen</title>
<description type="MAIN">
Saudi-Arabië heeft de bombardementscampagne 'Vastbesloten Storm' in Jemen voor beëindigd verklaard. De militaire doelen van die campagne zijn bereikt, zegt de regering in Riyad. Tegelijkertijd begint een nieuwe operatie in Jemen, die de naam 'Herstel van Hoop' krijgt.Daarbij gaat het volgens het Saudische ministerie van Defensie om het regelen van evacuaties in Jemen, het voorkomen van terreinwinst van de Houthi's en de bescherming van burgers.Koning SalmanEerder vandaag maakte de Saudische koning Salman bekend dat hij de Nationale Garde in zijn land opdracht heeft gegeven deel te nemen aan de strijd in het buurland Jemen. De nationale garde staat onder rechtstreeks bevel van het Saudische koningshuis. De gardisten staan al aan de grens opgesteld. Een invasie wordt echter onwaarschijnlijk geacht.Bijna een maand heeft de Saudische luchtmacht doelen in Jemen gebombardeerd. De Saudi's kwamen in actie naar aanleiding van de opmars van Houthi-rebellen in Jemen. Die hadden de macht in de hoofdstad Sanaa al maanden geleden overgenomen en stonden op het punt ook de zuidelijke havenstad Aden in te nemen.Bij de bombardementen zijn honderden doden gevallen. Vandaag melden artsen in Jemen veertig doden bij twee aanvallen. Gisteren vielen zeker twintig doden bij Saudische luchtaanvallen.
</description>
<tag>Jemen</tag>
<duration>P0DT0H4M13.000S</duration>
<locations/>
<scheduleEvents/>
<images/>
<start>P0DT1H8M1.000S</start>
</segment>
<segment midRef="RBX_NOS_703622" avType="AUDIO" embeddable="true" mid="RBX_NOS_839602" urn="urn:vpro:media:segment:54408053">
<crid>crid://audiofragment.radiobox2/182586</crid>
<broadcaster>NOS</broadcaster>
<title type="MAIN">Nationale Ik Stap Over Van Bank week</title>
<description type="MAIN">
Het rommelt in banken-land. Na de flinke salarisverhogingen voor de top van ING en ABN Amro, blijkt dat steeds meer mensen een andere bank zoeken. En dan is het ook nog de: 'Ik stap over van Bank week'. Bijna 4.000 mensen hebben deze week gezegd over te stappen. Bert van Slooten dook in de wereld van de overstappers
</description>
<duration>P0DT0H2M49.000S</duration>
<locations/>
<scheduleEvents/>
<images/>
<start>P0DT1H20M40.000S</start>
</segment>
</segments>
</program>
"""
> print(list((MU.iterate_objects(MU.segments_as_members(xml)))))
tests/unit/media_backend_util_test.py:277:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/npoapi/media_backend_util.py:327: in <lambda>
result = map(lambda m: MediaBackendUtil.map_member(m, binding), members)
/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/npoapi/media_backend_util.py:340: in map_member
return npoapi.utils.to_object(update, binding=binding, clazz=ProgramUpdateType)
/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/npoapi/utils.py:84: in to_object
result = poms.from_bytes(bytes, clazz)
/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/npoapi/data/poms.py:78: in from_bytes
return parser.from_bytes(source, clazz)
/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/xsdata/formats/bindings.py:26: in from_bytes
return self.parse(io.BytesIO(source), clazz)
/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/xsdata/formats/dataclass/parsers/bases.py:48: in parse
result = handler.parse(source)
/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/xsdata/formats/dataclass/parsers/handlers/lxml.py:51: in parse
return self.process_context(ctx)
/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/xsdata/formats/dataclass/parsers/handlers/lxml.py:57: in process_context
self.parser.start(
/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/xsdata/formats/dataclass/parsers/bases.py:87: in start
child = item.child(qname, attrs, ns_map, len(objects))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <xsdata.formats.dataclass.parsers.nodes.element.ElementNode object at 0x7fdd13f68050>
qname = '{urn:vpro:media:update:2009}start', attrs = {}
ns_map = {None: 'urn:vpro:media:update:2009'}, position = 8
def child(self, qname: str, attrs: Dict, ns_map: Dict, position: int) -> XmlNode:
for var in self.meta.find_children(qname):
unique = 0 if not var.is_element or var.list_element else var.index
if not unique or unique not in self.assigned:
node = self.build_node(qname, var, attrs, ns_map, position)
if node:
if unique:
self.assigned.add(unique)
return node
if self.config.fail_on_unknown_properties:
> raise ParserError(f"Unknown property {self.meta.qname}:{qname}")
E xsdata.exceptions.ParserError: Unknown property programUpdateType:{urn:vpro:media:update:2009}start
/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/xsdata/formats/dataclass/parsers/nodes/element.py:334: ParserError
Check warning on line 0 in tests.unit.xsdata_xml_test.Tests
github-actions / Tests results
test_prediction (tests.unit.xsdata_xml_test.Tests) failed
junit/test-results.xml [took 0s]
Raw output
AssertionError: Lists differ: [] != [InsertNamespace(prefix='pageupdate', uri=[282 chars]on')]
Second list contains 5 additional elements.
First extra element 0:
InsertNamespace(prefix='pageupdate', uri='urn:vpro:pages:update:2013')
- []
+ [InsertNamespace(prefix='pageupdate', uri='urn:vpro:pages:update:2013'),
+ InsertNamespace(prefix='media', uri='urn:vpro:media:2009'),
+ InsertNamespace(prefix='pages', uri='urn:vpro:pages:2013'),
+ InsertNamespace(prefix='api', uri='urn:vpro:api:2013'),
+ RenameNode(node='/prediction[1]', tag='{urn:vpro:media:update:2009}prediction')]
self = <tests.unit.xsdata_xml_test.Tests testMethod=test_prediction>
def test_prediction(self):
prediction = Prediction()
prediction.value = "INTERNETVOD"
> self.xml_assert(
"""
<?xml version="1.0" encoding="UTF-8"?>
<prediction xmlns:update="urn:vpro:media:update:2009">INTERNETVOD</prediction>
""", prediction)
tests/unit/xsdata_xml_test.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/unit/xsdata_xml_test.py:20: in xml_assert
self.assertEqual([],main.diff_texts(expected.strip().encode("UTF-8"), real.encode("UTF-8")))
E AssertionError: Lists differ: [] != [InsertNamespace(prefix='pageupdate', uri=[282 chars]on')]
E
E Second list contains 5 additional elements.
E First extra element 0:
E InsertNamespace(prefix='pageupdate', uri='urn:vpro:pages:update:2013')
E
E - []
E + [InsertNamespace(prefix='pageupdate', uri='urn:vpro:pages:update:2013'),
E + InsertNamespace(prefix='media', uri='urn:vpro:media:2009'),
E + InsertNamespace(prefix='pages', uri='urn:vpro:pages:2013'),
E + InsertNamespace(prefix='api', uri='urn:vpro:api:2013'),
E + RenameNode(node='/prediction[1]', tag='{urn:vpro:media:update:2009}prediction')]
Loading