Skip to content

Commit 07d74db

Browse files
author
Cristi Constantin
committed
Sort RDFa values in the tests to match the HTML
1 parent fdb5a4a commit 07d74db

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

tests/samples/songkick/elysianfields.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<meta property="og:site_name" content="Songkick">
2828
<meta property="og:type" content="songkick-concerts:artist">
2929
<meta property="og:title" content="Elysian Fields">
30+
<meta property="og:title" content=" ">
3031
<meta property="og:description" content="Buy tickets for an upcoming Elysian Fields concert near you. List of all Elysian Fields tickets and tour dates for 2017.">
3132
<meta property="og:description" content="" />
3233
<meta property="og:url" content="http://www.songkick.com/artists/236156-elysian-fields">

tests/samples/songkick/elysianfields.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,18 +231,18 @@
231231
],
232232
"http://ogp.me/ns#description": [
233233
{
234-
"@value": ""
234+
"@value": "Buy tickets for an upcoming Elysian Fields concert near you. List of all Elysian Fields tickets and tour dates for 2017."
235235
},
236236
{
237-
"@value": "Buy tickets for an upcoming Elysian Fields concert near you. List of all Elysian Fields tickets and tour dates for 2017."
237+
"@value": ""
238238
}
239239
],
240240
"http://ogp.me/ns#image": [
241241
{
242-
"@value": "http://images.sk-static.com/SECONDARY_IMAGE.jpg"
242+
"@value": "http://images.sk-static.com/images/media/img/col4/20100330-103600-169450.jpg"
243243
},
244244
{
245-
"@value": "http://images.sk-static.com/images/media/img/col4/20100330-103600-169450.jpg"
245+
"@value": "http://images.sk-static.com/SECONDARY_IMAGE.jpg"
246246
}
247247
],
248248
"http://ogp.me/ns#site_name": [
@@ -253,6 +253,9 @@
253253
"http://ogp.me/ns#title": [
254254
{
255255
"@value": "Elysian Fields"
256+
},
257+
{
258+
"@value": " "
256259
}
257260
],
258261
"http://ogp.me/ns#type": [

tests/test_extruct.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_all(self):
2222
for rdf in data['rdfa']:
2323
for key, pairs in rdf.items():
2424
if ':' in key and isinstance(pairs, list):
25-
rdf[key] = sorted(pairs, key=lambda e: e["@value"])
25+
rdf[key] = sorted(pairs, key=lambda e: e["@value"], reverse=True)
2626
self.assertEqual(jsonize_dict(data), expected)
2727

2828
@pytest.mark.xfail

0 commit comments

Comments
 (0)