From e2deb74b7839aa05c1827a830ffc5e3c68ed58b4 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 14 Dec 2018 20:57:15 +0800 Subject: fix brittle/flapping python matched test --- python/tests/import_matched.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'python') diff --git a/python/tests/import_matched.py b/python/tests/import_matched.py index 85e21267..4f2f0867 100644 --- a/python/tests/import_matched.py +++ b/python/tests/import_matched.py @@ -25,8 +25,10 @@ def test_matched_dict_parse(matched_importer): assert f.md5 == "f4de91152c7ab9fdc2a128f962faebff" assert f.mimetype == "application/pdf" assert f.size == 255629 - assert f.urls[1].url.startswith("http://journals.plos.org") - assert f.urls[1].rel == "web" - assert f.urls[0].url.startswith("https://web.archive.org/") - assert f.urls[0].rel == "webarchive" + assert len(f.urls) == 2 + for u in f.urls: + if u.rel == "web": + assert u.url.startswith("http://journals.plos.org") + if u.rel == "webarchive": + assert u.url.startswith("https://web.archive.org/") assert len(f.releases) == 1 -- cgit v1.2.3