Skip to content

Commit

Permalink
Added comment to explain sorting rdfa in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristi Constantin committed Jul 16, 2019
1 parent 3aaebd5 commit 843b2e6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_extruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def test_all(self):
body = get_testdata('songkick', 'elysianfields.html')
expected = json.loads(get_testdata('songkick', 'elysianfields.json').decode('UTF-8'))
data = extruct.extract(body, base_url='http://www.songkick.com/artists/236156-elysian-fields')
# Sorting the values here because RDFa is not preserving ordering on duplicated properties.
# See https://github.com/scrapinghub/extruct/issues/116
for rdf in data['rdfa']:
for key, pairs in rdf.items():
if ':' in key and isinstance(pairs, list):
Expand Down

0 comments on commit 843b2e6

Please sign in to comment.